fix(markdown extensions): Rename tag name allow list method name

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-09-02 22:52:50 +02:00
parent 7a9951e351
commit afe35ca164
10 changed files with 14 additions and 14 deletions

View file

@ -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]
}
}

View file

@ -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]
}
}

View file

@ -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']
}
}

View file

@ -33,7 +33,7 @@ export class KatexMarkdownExtension extends MarkdownExtension {
return [new KatexReplacer()]
}
public buildTagNameWhitelist(): string[] {
public buildTagNameAllowList(): string[] {
return [KatexMarkdownExtension.tagName]
}
}

View file

@ -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]
}
}

View file

@ -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)]
}

View file

@ -31,7 +31,7 @@ export abstract class MarkdownExtension {
return []
}
public buildTagNameWhitelist(): string[] {
public buildTagNameAllowList(): string[] {
return []
}

View file

@ -46,7 +46,7 @@ export class PlantumlMarkdownExtension extends MarkdownExtension {
.orElseGet(() => this.plantumlError(markdownIt))
}
public buildTagNameWhitelist(): string[] {
public buildTagNameAllowList(): string[] {
return ['plantuml-not-configured']
}

View file

@ -30,7 +30,7 @@ export class VimeoMarkdownExtension extends MarkdownExtension {
return [new CustomTagWithIdComponentReplacer(VimeoFrame, VimeoMarkdownExtension.tagName)]
}
public buildTagNameWhitelist(): string[] {
public buildTagNameAllowList(): string[] {
return [VimeoMarkdownExtension.tagName]
}

View file

@ -30,7 +30,7 @@ export class YoutubeMarkdownExtension extends MarkdownExtension {
return [new CustomTagWithIdComponentReplacer(YouTubeFrame, YoutubeMarkdownExtension.tagName)]
}
public buildTagNameWhitelist(): string[] {
public buildTagNameAllowList(): string[] {
return [YoutubeMarkdownExtension.tagName]
}