mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 11:16:31 -05:00
fix(markdown extensions): Rename tag name allow list method name
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
7a9951e351
commit
afe35ca164
10 changed files with 14 additions and 14 deletions
|
@ -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
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
@ -33,7 +33,7 @@ export class BlockquoteExtraTagMarkdownExtension extends MarkdownExtension {
|
||||||
return [new BlockquoteBorderColorNodePreprocessor()]
|
return [new BlockquoteBorderColorNodePreprocessor()]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return [BlockquoteExtraTagMarkdownExtension.tagName]
|
return [BlockquoteExtraTagMarkdownExtension.tagName]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
@ -28,7 +28,7 @@ export class GistMarkdownExtension extends MarkdownExtension {
|
||||||
return [new CustomTagWithIdComponentReplacer(GistFrame, GistMarkdownExtension.tagName)]
|
return [new CustomTagWithIdComponentReplacer(GistFrame, GistMarkdownExtension.tagName)]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return [GistMarkdownExtension.tagName]
|
return [GistMarkdownExtension.tagName]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
@ -16,7 +16,7 @@ export class IframeCapsuleMarkdownExtension extends MarkdownExtension {
|
||||||
return [new IframeCapsuleReplacer()]
|
return [new IframeCapsuleReplacer()]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return ['iframe']
|
return ['iframe']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ export class KatexMarkdownExtension extends MarkdownExtension {
|
||||||
return [new KatexReplacer()]
|
return [new KatexReplacer()]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return [KatexMarkdownExtension.tagName]
|
return [KatexMarkdownExtension.tagName]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
@ -29,7 +29,7 @@ export class LinemarkerMarkdownExtension extends MarkdownExtension {
|
||||||
return [new LinemarkerReplacer()]
|
return [new LinemarkerReplacer()]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return [LinemarkerMarkdownExtension.tagName]
|
return [LinemarkerMarkdownExtension.tagName]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ export class MarkdownExtensionCollection {
|
||||||
private extensions: MarkdownExtension[]
|
private extensions: MarkdownExtension[]
|
||||||
|
|
||||||
public constructor(additionalExtensions: 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)]
|
this.extensions = [...additionalExtensions, new SanitizerMarkdownExtension(tagWhiteLists)]
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ export abstract class MarkdownExtension {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ export class PlantumlMarkdownExtension extends MarkdownExtension {
|
||||||
.orElseGet(() => this.plantumlError(markdownIt))
|
.orElseGet(() => this.plantumlError(markdownIt))
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return ['plantuml-not-configured']
|
return ['plantuml-not-configured']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ export class VimeoMarkdownExtension extends MarkdownExtension {
|
||||||
return [new CustomTagWithIdComponentReplacer(VimeoFrame, VimeoMarkdownExtension.tagName)]
|
return [new CustomTagWithIdComponentReplacer(VimeoFrame, VimeoMarkdownExtension.tagName)]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return [VimeoMarkdownExtension.tagName]
|
return [VimeoMarkdownExtension.tagName]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ export class YoutubeMarkdownExtension extends MarkdownExtension {
|
||||||
return [new CustomTagWithIdComponentReplacer(YouTubeFrame, YoutubeMarkdownExtension.tagName)]
|
return [new CustomTagWithIdComponentReplacer(YouTubeFrame, YoutubeMarkdownExtension.tagName)]
|
||||||
}
|
}
|
||||||
|
|
||||||
public buildTagNameWhitelist(): string[] {
|
public buildTagNameAllowList(): string[] {
|
||||||
return [YoutubeMarkdownExtension.tagName]
|
return [YoutubeMarkdownExtension.tagName]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue