diff --git a/frontend/src/extensions/essential-app-extensions/blockquote/__snapshots__/blockquote-extra-tag-markdown-extension.spec.tsx.snap b/frontend/src/extensions/essential-app-extensions/blockquote/__snapshots__/blockquote-extra-tag-markdown-extension.spec.tsx.snap index 417908430..6da670d01 100644 --- a/frontend/src/extensions/essential-app-extensions/blockquote/__snapshots__/blockquote-extra-tag-markdown-extension.spec.tsx.snap +++ b/frontend/src/extensions/essential-app-extensions/blockquote/__snapshots__/blockquote-extra-tag-markdown-extension.spec.tsx.snap @@ -46,11 +46,10 @@ exports[`blockquote extra tag renders the tag "[color=#abcdef]" correctly 1`] =

- - BootstrapIconMock_Tag + + [color= + #abcdef + ]

@@ -66,11 +65,10 @@ exports[`blockquote extra tag renders the tag "[color=#dfe]" correctly 1`] = `

- - BootstrapIconMock_Tag + + [color= + #dfe + ]

@@ -101,10 +99,10 @@ exports[`blockquote extra tag renders the tag "[color=notarealcolor]" correctly

- + + [color= notarealcolor + ]

@@ -120,11 +118,10 @@ exports[`blockquote extra tag renders the tag "[color=white]" correctly 1`] = `

- - BootstrapIconMock_Tag + + [color= + white + ]

diff --git a/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-color-extra-tag-replacer.tsx b/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-color-extra-tag-replacer.tsx index 807b2ba97..876dbe794 100644 --- a/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-color-extra-tag-replacer.tsx +++ b/frontend/src/extensions/essential-app-extensions/blockquote/blockquote-color-extra-tag-replacer.tsx @@ -1,21 +1,18 @@ /* - * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file) * * SPDX-License-Identifier: AGPL-3.0-only */ -import { UiIcon } from '../../../components/common/icons/ui-icon' import type { NodeReplacement } from '../../../components/markdown-renderer/replace-components/component-replacer' import { ComponentReplacer, DO_NOT_REPLACE } from '../../../components/markdown-renderer/replace-components/component-replacer' -import { cssColor } from './blockquote-border-color-node-preprocessor' import { BlockquoteExtraTagMarkdownExtension } from './blockquote-extra-tag-markdown-extension' import { Optional } from '@mrdrogdrog/optional' import type { Element } from 'domhandler' import { isText } from 'domhandler' import type { Text } from 'domhandler/lib/node' -import { Tag as IconTag } from 'react-bootstrap-icons' /** * Replaces elements with "color" as label and a valid color as content @@ -32,13 +29,7 @@ export class BlockquoteColorExtraTagReplacer extends ComponentReplacer { ) .map((element) => element.children[0]) .filter(isText) - .map((child) => (child as Text).data) - .filter((content) => cssColor.test(content)) - .map((color) => ( - - - - )) + .map((child) => [color={(child as Text).data}]) .orElse(DO_NOT_REPLACE) } }