From 3b8ab18adda9023f79aaa6d1e377d710d8a09f38 Mon Sep 17 00:00:00 2001 From: tgreyuk Date: Thu, 24 Jun 2021 13:07:18 +0100 Subject: [PATCH] fix: Fix string escape inside backticks --- .../src/resources/helpers/declaration-title.ts | 5 +---- .../typedoc-plugin-markdown/src/resources/helpers/type.ts | 5 ++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/typedoc-plugin-markdown/src/resources/helpers/declaration-title.ts b/packages/typedoc-plugin-markdown/src/resources/helpers/declaration-title.ts index 28fa30dc2..29d38bc3b 100644 --- a/packages/typedoc-plugin-markdown/src/resources/helpers/declaration-title.ts +++ b/packages/typedoc-plugin-markdown/src/resources/helpers/declaration-title.ts @@ -4,7 +4,6 @@ import { ReflectionKind, ReflectionType, } from 'typedoc/dist/lib/models'; - import { escape } from './escape'; import { memberSymbol } from './member-symbol'; import { stripComments } from './strip-comments'; @@ -36,9 +35,7 @@ export function declarationTitle( this.defaultValue && this.defaultValue !== '...' ) { - md.push( - ` = \`${stripLineBreaks(escape(stripComments(this.defaultValue)))}\``, - ); + md.push(` = \`${stripLineBreaks(stripComments(this.defaultValue))}\``); } return md.join(''); } diff --git a/packages/typedoc-plugin-markdown/src/resources/helpers/type.ts b/packages/typedoc-plugin-markdown/src/resources/helpers/type.ts index c06554055..3b2f75eea 100644 --- a/packages/typedoc-plugin-markdown/src/resources/helpers/type.ts +++ b/packages/typedoc-plugin-markdown/src/resources/helpers/type.ts @@ -17,7 +17,6 @@ import { UnionType, UnknownType, } from 'typedoc/dist/lib/models/types'; - import MarkdownTheme from '../../theme'; import { escape } from './escape'; @@ -202,7 +201,7 @@ function getReferenceType(model: ReferenceType, emphasis) { } return reflection.join(''); } - return emphasis ? `\`${escape(model.name)}\`` : escape(model.name); + return emphasis ? `\`${model.name}\`` : escape(model.name); } function getArrayType(model: ArrayType, emphasis: boolean) { @@ -229,7 +228,7 @@ function getTupleType(model: TupleType) { } function getIntrinsicType(model: IntrinsicType, emphasis: boolean) { - return emphasis ? `\`${escape(model.name)}\`` : escape(model.name); + return emphasis ? `\`${model.name}\`` : escape(model.name); } function getTypeOperatorType(model: TypeOperatorType) {