From afe35ca164186cfb59385019d48db1f1233aece7 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Fri, 2 Sep 2022 22:52:50 +0200 Subject: [PATCH] fix(markdown extensions): Rename tag name allow list method name Signed-off-by: Tilman Vatteroth --- .../blockquote/blockquote-extra-tag-markdown-extension.ts | 4 ++-- .../markdown-extension/gist/gist-markdown-extension.ts | 4 ++-- .../iframe-capsule/iframe-capsule-markdown-extension.ts | 4 ++-- .../markdown-extension/katex/katex-markdown-extension.ts | 2 +- .../linemarker/linemarker-markdown-extension.ts | 4 ++-- .../markdown-extension/markdown-extension-collection.ts | 2 +- .../markdown-extension/markdown-extension.ts | 2 +- .../plantuml/plantuml-markdown-extension.ts | 2 +- .../markdown-extension/vimeo/vimeo-markdown-extension.ts | 2 +- .../markdown-extension/youtube/youtube-markdown-extension.ts | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/components/markdown-renderer/markdown-extension/blockquote/blockquote-extra-tag-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/blockquote/blockquote-extra-tag-markdown-extension.ts index 271be3572..b404e2cd9 100644 --- a/src/components/markdown-renderer/markdown-extension/blockquote/blockquote-extra-tag-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/blockquote/blockquote-extra-tag-markdown-extension.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -33,7 +33,7 @@ export class BlockquoteExtraTagMarkdownExtension extends MarkdownExtension { return [new BlockquoteBorderColorNodePreprocessor()] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [BlockquoteExtraTagMarkdownExtension.tagName] } } diff --git a/src/components/markdown-renderer/markdown-extension/gist/gist-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/gist/gist-markdown-extension.ts index 0a7cbacf9..56042c13a 100644 --- a/src/components/markdown-renderer/markdown-extension/gist/gist-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/gist/gist-markdown-extension.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -28,7 +28,7 @@ export class GistMarkdownExtension extends MarkdownExtension { return [new CustomTagWithIdComponentReplacer(GistFrame, GistMarkdownExtension.tagName)] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [GistMarkdownExtension.tagName] } } diff --git a/src/components/markdown-renderer/markdown-extension/iframe-capsule/iframe-capsule-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/iframe-capsule/iframe-capsule-markdown-extension.ts index 23bcd8a5d..efcbe42ae 100644 --- a/src/components/markdown-renderer/markdown-extension/iframe-capsule/iframe-capsule-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/iframe-capsule/iframe-capsule-markdown-extension.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -16,7 +16,7 @@ export class IframeCapsuleMarkdownExtension extends MarkdownExtension { return [new IframeCapsuleReplacer()] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return ['iframe'] } } diff --git a/src/components/markdown-renderer/markdown-extension/katex/katex-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/katex/katex-markdown-extension.ts index 851f686a8..c00e369e3 100644 --- a/src/components/markdown-renderer/markdown-extension/katex/katex-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/katex/katex-markdown-extension.ts @@ -33,7 +33,7 @@ export class KatexMarkdownExtension extends MarkdownExtension { return [new KatexReplacer()] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [KatexMarkdownExtension.tagName] } } diff --git a/src/components/markdown-renderer/markdown-extension/linemarker/linemarker-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/linemarker/linemarker-markdown-extension.ts index 07f524820..e139824a4 100644 --- a/src/components/markdown-renderer/markdown-extension/linemarker/linemarker-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/linemarker/linemarker-markdown-extension.ts @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ @@ -29,7 +29,7 @@ export class LinemarkerMarkdownExtension extends MarkdownExtension { return [new LinemarkerReplacer()] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [LinemarkerMarkdownExtension.tagName] } } diff --git a/src/components/markdown-renderer/markdown-extension/markdown-extension-collection.ts b/src/components/markdown-renderer/markdown-extension/markdown-extension-collection.ts index b99ab5fd0..cf7d3969b 100644 --- a/src/components/markdown-renderer/markdown-extension/markdown-extension-collection.ts +++ b/src/components/markdown-renderer/markdown-extension/markdown-extension-collection.ts @@ -17,7 +17,7 @@ export class MarkdownExtensionCollection { private extensions: MarkdownExtension[] public constructor(additionalExtensions: MarkdownExtension[]) { - const tagWhiteLists = additionalExtensions.flatMap((extension) => extension.buildTagNameWhitelist()) + const tagWhiteLists = additionalExtensions.flatMap((extension) => extension.buildTagNameAllowList()) this.extensions = [...additionalExtensions, new SanitizerMarkdownExtension(tagWhiteLists)] } diff --git a/src/components/markdown-renderer/markdown-extension/markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/markdown-extension.ts index 85149bd6d..0663ee548 100644 --- a/src/components/markdown-renderer/markdown-extension/markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/markdown-extension.ts @@ -31,7 +31,7 @@ export abstract class MarkdownExtension { return [] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [] } diff --git a/src/components/markdown-renderer/markdown-extension/plantuml/plantuml-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/plantuml/plantuml-markdown-extension.ts index 64e732649..ce5c22ebf 100644 --- a/src/components/markdown-renderer/markdown-extension/plantuml/plantuml-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/plantuml/plantuml-markdown-extension.ts @@ -46,7 +46,7 @@ export class PlantumlMarkdownExtension extends MarkdownExtension { .orElseGet(() => this.plantumlError(markdownIt)) } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return ['plantuml-not-configured'] } diff --git a/src/components/markdown-renderer/markdown-extension/vimeo/vimeo-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/vimeo/vimeo-markdown-extension.ts index 6b6efd7ee..e0d96a676 100644 --- a/src/components/markdown-renderer/markdown-extension/vimeo/vimeo-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/vimeo/vimeo-markdown-extension.ts @@ -30,7 +30,7 @@ export class VimeoMarkdownExtension extends MarkdownExtension { return [new CustomTagWithIdComponentReplacer(VimeoFrame, VimeoMarkdownExtension.tagName)] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [VimeoMarkdownExtension.tagName] } diff --git a/src/components/markdown-renderer/markdown-extension/youtube/youtube-markdown-extension.ts b/src/components/markdown-renderer/markdown-extension/youtube/youtube-markdown-extension.ts index f619c7c7f..e2eac2c10 100644 --- a/src/components/markdown-renderer/markdown-extension/youtube/youtube-markdown-extension.ts +++ b/src/components/markdown-renderer/markdown-extension/youtube/youtube-markdown-extension.ts @@ -30,7 +30,7 @@ export class YoutubeMarkdownExtension extends MarkdownExtension { return [new CustomTagWithIdComponentReplacer(YouTubeFrame, YoutubeMarkdownExtension.tagName)] } - public buildTagNameWhitelist(): string[] { + public buildTagNameAllowList(): string[] { return [YoutubeMarkdownExtension.tagName] }