diff --git a/.gitignore b/.gitignore index 19bf949ed..d88227adf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ yarn-error.log typedoc*.tgz tmp + +src/test/renderer/specs/assets/* diff --git a/examples/basic/src/classes.ts b/examples/basic/src/classes.ts index ad445cd79..c12c423c7 100644 --- a/examples/basic/src/classes.ts +++ b/examples/basic/src/classes.ts @@ -1,11 +1,33 @@ /** * This is a simple interface. + * + * Links - these should all point to the name property: + * - {@link name} + * - {@link NameInterface.name} + * - {@link "classes".NameInterface.name} + * - {@link name Text} <-- This one goes away eventually + * - {@link name|Text} + * - {@link name | Text} + * - {@link NameInterface.name | Text} */ export interface NameInterface { /** * This is a interface member of INameInterface. * * It should be inherited by all subinterfaces. + * + * Links - these should all point to this property: + * - {@link name} + * - {@link NameInterface.name} + * - {@link "classes".NameInterface.name} + * - {@link name Text} <-- This one goes away eventually + * - {@link name|Text} + * - {@link name | Text} + * - {@link NameInterface.name | Text} + * + * Links - these should point to the containing interface + * - {@link NameInterface} + * - {@link "classes".NameInterface} */ name: string; @@ -43,6 +65,10 @@ export interface PrintNameInterface extends NameInterface, PrintInterface { * This is a simple base class. * * [[include:class-example.md]] + * + * Links: + * - {@link name | The name property on this class} + * - {@link NameInterface.name | The name property we inherit from the interface} */ export abstract class BaseClass implements NameInterface { /** diff --git a/scripts/rebuild_specs.js b/scripts/rebuild_specs.js index c6700d628..245941657 100644 --- a/scripts/rebuild_specs.js +++ b/scripts/rebuild_specs.js @@ -84,7 +84,6 @@ async function rebuildRendererTest() { app.options.setValue('excludeExternals', false); app.generateDocs(app.expandInputFiles([src]), out) app.options.setValue('excludeExternals', true); - await fs.remove(path.join(out, 'assets')) /** * Avoiding sync methods here is... difficult. diff --git a/src/lib/output/plugins/MarkedLinksPlugin.ts b/src/lib/output/plugins/MarkedLinksPlugin.ts index 4010fcb69..fb2657c03 100644 --- a/src/lib/output/plugins/MarkedLinksPlugin.ts +++ b/src/lib/output/plugins/MarkedLinksPlugin.ts @@ -16,7 +16,7 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent { private brackets: RegExp = /\[\[([^\]]+)\]\]/g; /** - * Regular expression for detecting inline tags like {@link ...}. + * Regular expression for detecting inline tags like {&link ...}. */ private inlineTag: RegExp = /(?:\[(.+?)\])?\{@(link|linkcode|linkplain)\s+((?:.|\n)+?)\}/gi; @@ -56,7 +56,7 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent { } /** - * Find symbol {@link ...} strings in text and turn into html links + * Find symbol {&link ...} strings in text and turn into html links * * @param text The string in which to replace the inline tags. * @return The updated string. @@ -152,8 +152,8 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent { if (splitIndex !== -1) { return { - caption: text.substr(splitIndex + 1).replace(/\n+/, ' '), - target: text.substr(0, splitIndex) + caption: text.substr(splitIndex + 1).replace(/\n+/, ' ').trim(), + target: text.substr(0, splitIndex).trim() }; } else { return { diff --git a/src/test/renderer/specs/classes/_classes_.baseclass.html b/src/test/renderer/specs/classes/_classes_.baseclass.html index 3b2c2b7a4..83dfabfde 100644 --- a/src/test/renderer/specs/classes/_classes_.baseclass.html +++ b/src/test/renderer/specs/classes/_classes_.baseclass.html @@ -75,6 +75,11 @@

Class BaseClass

This is a simple base class.

[[include:class-example.md]]

+

Links:

+
diff --git a/src/test/renderer/specs/interfaces/_classes_.nameinterface.html b/src/test/renderer/specs/interfaces/_classes_.nameinterface.html index f67a5e052..ad4911e50 100644 --- a/src/test/renderer/specs/interfaces/_classes_.nameinterface.html +++ b/src/test/renderer/specs/interfaces/_classes_.nameinterface.html @@ -74,6 +74,16 @@

Interface NameInterface

This is a simple interface.

+

Links - these should all point to the name property:

+
@@ -129,6 +139,21 @@

name

This is a interface member of INameInterface.

It should be inherited by all subinterfaces.

+

Links - these should all point to this property:

+ +

Links - these should point to the containing interface

+
diff --git a/src/test/renderer/specs/interfaces/_classes_.printnameinterface.html b/src/test/renderer/specs/interfaces/_classes_.printnameinterface.html index 66226bff2..02a9df1f6 100644 --- a/src/test/renderer/specs/interfaces/_classes_.printnameinterface.html +++ b/src/test/renderer/specs/interfaces/_classes_.printnameinterface.html @@ -133,6 +133,21 @@

name

This is a interface member of INameInterface.

It should be inherited by all subinterfaces.

+

Links - these should all point to this property:

+ +

Links - these should point to the containing interface

+