Skip to content

Commit 3dfb539

Browse files
committed
Do not attempt to resolve includes as links
Resolves #1986
1 parent 83a2735 commit 3dfb539

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- Improved support for `--entryPointStrategy Packages`. TypeDoc will now load package-specific configurations from `package.json` `typedoc` field. This configuration allows configuring a custom display name (`typedoc.displayName`) field, entry point (`typedoc.entryPoint` - this is equivalent and will override `typedocMain`), and path to a readme file to be rendered at the top of the package page (`typedoc.readmeFile`), #1658.
66
- The `--includeVersion` option will now be respected by `--entryPointStrategy Packages`. Also, for this combination, missing `version` field in the root `package.json` will not issue a warning.
77

8+
### Bug Fixes
9+
10+
- Include references will no longer be incorrectly parsed as links, #1986.
11+
812
## v0.23.5 (2022-07-02)
913

1014
### Features

src/lib/converter/plugins/LinkResolverPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
import { DeclarationReflection } from "../../models";
1414

1515
const urlPrefix = /^(http|ftp)s?:\/\//;
16-
const brackets = /\[\[([^\]]+)\]\]/g;
16+
const brackets = /\[\[(?!include:)([^\]]+)\]\]/g;
1717
/**
1818
* A plugin that resolves `{@link Foo}` tags.
1919
*/

src/test/converter2/issues/gh1986.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/**
2+
* [[include:file.md]] this is not a link.
3+
*/
4+
export const a = 123;

src/test/issueTests.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,4 +598,14 @@ export const issueTests: {
598598

599599
equal(comments2, ["Comment for a", "Comment for b"]);
600600
},
601+
602+
gh1986(project, logger) {
603+
const a = query(project, "a");
604+
equal(
605+
Comment.combineDisplayParts(a.comment?.summary),
606+
"[[include:file.md]] this is not a link."
607+
);
608+
logger.discardDebugMessages();
609+
logger.expectNoOtherMessages();
610+
},
601611
};

0 commit comments

Comments
 (0)