diff --git a/devtools/packages/fixtures/typedoc.cjs b/devtools/packages/fixtures/typedoc.cjs index ae6b2e975..3b9925aab 100644 --- a/devtools/packages/fixtures/typedoc.cjs +++ b/devtools/packages/fixtures/typedoc.cjs @@ -12,4 +12,7 @@ module.exports = { URL: 'https://developer.mozilla.org/en-US/docs/Web/API/URL', }, }, + navigation: { + includeGroups: true, + }, }; diff --git a/packages/typedoc-plugin-markdown/src/libs/markdown/back-ticks.ts b/packages/typedoc-plugin-markdown/src/libs/markdown/back-ticks.ts index adfc27560..c832f68a5 100644 --- a/packages/typedoc-plugin-markdown/src/libs/markdown/back-ticks.ts +++ b/packages/typedoc-plugin-markdown/src/libs/markdown/back-ticks.ts @@ -2,7 +2,7 @@ import { escapeChars } from '../utils'; /** * Wraps a string in backticks. - * If the input string iself contains a backtick, pipe, or backslash (which can result in unwanted side effects) the string is escaoed unstead. + * If the input string itself contains a backtick, pipe, or backslash (which can result in unwanted side effects) the string is escaped instead. */ export function backTicks(text: string) { return /(`|\||\\)/g.test(text) ? escapeChars(text) : `\`${text}\``; diff --git a/packages/typedoc-plugin-markdown/src/theme/resources/partials/type.some.ts b/packages/typedoc-plugin-markdown/src/theme/resources/partials/type.some.ts index 76429e070..57670dcbe 100644 --- a/packages/typedoc-plugin-markdown/src/theme/resources/partials/type.some.ts +++ b/packages/typedoc-plugin-markdown/src/theme/resources/partials/type.some.ts @@ -88,7 +88,5 @@ export function someType(this: MarkdownThemeContext, model?: SomeType): string { return backTicks('null'); } - return /\\/.test(model?.toString()) - ? model?.toString() - : backTicks(model?.toString()); + return backTicks(model?.toString()); } diff --git a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts index 2a963f97a..58baab1a2 100644 --- a/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts +++ b/packages/typedoc-plugin-markdown/test/fixtures/src/reflections/variables.ts @@ -7,6 +7,15 @@ */ export const stringVariable = 'stringConstWithDefaultValue'; +/** + * A template variable string + */ +export const templateVariableString = ` +This is a template string +/* with a comment */ +And a +`; + /** * Comments for typeOperatorVariable */ diff --git a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/navigation.spec.ts.snap b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/navigation.spec.ts.snap index 7f7f33498..01ed49792 100644 --- a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/navigation.spec.ts.snap +++ b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/navigation.spec.ts.snap @@ -2999,6 +2999,11 @@ exports[`Navigation should gets Navigation Json for single entry point: (Output "kind": 32, "path": "variables/stringVariable.md" }, + { + "title": "templateVariableString", + "kind": 32, + "path": "variables/templateVariableString.md" + }, { "title": "typeOperatorVariable", "kind": 32, diff --git a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/reflection.variable.spec.ts.snap b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/reflection.variable.spec.ts.snap index 00596d1f5..5810c4935 100644 --- a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/reflection.variable.spec.ts.snap +++ b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/reflection.variable.spec.ts.snap @@ -17,7 +17,7 @@ Comments for symbol ## Source -[variables.ts:38](http://source-url) +[variables.ts:47](http://source-url) " `; @@ -38,7 +38,7 @@ Comments variable with symbol ## Source -[variables.ts:38](http://source-url) +[variables.ts:47](http://source-url) " `; @@ -51,7 +51,7 @@ Comments for typeOperatorVariable ## Source -[variables.ts:13](http://source-url) +[variables.ts:22](http://source-url) " `; @@ -66,7 +66,7 @@ Comments for typeOperatorVariable ## Source -[variables.ts:13](http://source-url) +[variables.ts:22](http://source-url) " `; @@ -175,7 +175,7 @@ Comments for objectLiteralVariable ## Source -[variables.ts:18](http://source-url) +[variables.ts:27](http://source-url) " `; @@ -202,6 +202,6 @@ Comments for objectLiteralVariable ## Source -[variables.ts:18](http://source-url) +[variables.ts:27](http://source-url) " `; diff --git a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/urls.spec.ts.snap b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/urls.spec.ts.snap index 38a65456d..ee34b2a81 100644 --- a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/urls.spec.ts.snap +++ b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/urls.spec.ts.snap @@ -569,6 +569,7 @@ exports[`Urls should gets Urls for single entry points: outputFileStrategy: memb "variables/objectWithSymbol.md", "variables/someQuery.md", "variables/stringVariable.md", + "variables/templateVariableString.md", "variables/typeOperatorVariable.md", ] `; @@ -643,6 +644,7 @@ exports[`Urls should gets Urls for single entry points: outputFileStrategy: memb "variables/objectWithSymbol.md", "variables/someQuery.md", "variables/stringVariable.md", + "variables/templateVariableString.md", "variables/typeOperatorVariable.md", ] `;