Skip to content

Commit 686c99f

Browse files
authored
refactor: remove double replace for markdown (#12706)
1 parent 8947fec commit 686c99f

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

ui/src/components/layout/Markdown.vue

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@
6868
const fontSizeCss = computed(() => `var(--${props.fontSizeVar})`);
6969
const hasMatches = computed(() => hasMatchesRef.value);
7070
71-
/**
72-
* Replace custom alert syntax (legacy component behavior)
73-
* ::alert{type="info"} ... ::: -> ::: info ... :::
74-
*/
75-
function replaceAlertSyntax(source: string | undefined) {
76-
if (!source) return "";
77-
return source.replace(
78-
/(\n)?:\s*:\s*alert\{type="(.*?)"\}\s*\n([\s\S]*?)\n:\s*:(\n)?/g,
79-
(_, newLine1, type, content, newLine2) =>
80-
`${newLine1 ?? ""}::: ${type}\n${content}\n:::${newLine2 ?? ""}`
81-
);
82-
}
83-
8471
/**
8572
* RENDERING
8673
*/
@@ -109,9 +96,7 @@
10996
return;
11097
}
11198
112-
const source = replaceAlertSyntax(props.source);
113-
114-
markdownHtml.value = await Markdown.render(source, {
99+
markdownHtml.value = await Markdown.render(props.source, {
115100
permalink: props.permalink,
116101
html: props.html,
117102
variant: props.variant,

0 commit comments

Comments
 (0)