mirror of
https://github.com/kestra-io/kestra.git
synced 2025-12-25 02:14:38 -05:00
refactor: remove double replace for markdown (#12706)
This commit is contained in:
committed by
GitHub
parent
8947fec1a4
commit
686c99f09a
@@ -68,19 +68,6 @@
|
||||
const fontSizeCss = computed(() => `var(--${props.fontSizeVar})`);
|
||||
const hasMatches = computed(() => hasMatchesRef.value);
|
||||
|
||||
/**
|
||||
* Replace custom alert syntax (legacy component behavior)
|
||||
* ::alert{type="info"} ... ::: -> ::: info ... :::
|
||||
*/
|
||||
function replaceAlertSyntax(source: string | undefined) {
|
||||
if (!source) return "";
|
||||
return source.replace(
|
||||
/(\n)?:\s*:\s*alert\{type="(.*?)"\}\s*\n([\s\S]*?)\n:\s*:(\n)?/g,
|
||||
(_, newLine1, type, content, newLine2) =>
|
||||
`${newLine1 ?? ""}::: ${type}\n${content}\n:::${newLine2 ?? ""}`
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* RENDERING
|
||||
*/
|
||||
@@ -109,9 +96,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
const source = replaceAlertSyntax(props.source);
|
||||
|
||||
markdownHtml.value = await Markdown.render(source, {
|
||||
markdownHtml.value = await Markdown.render(props.source, {
|
||||
permalink: props.permalink,
|
||||
html: props.html,
|
||||
variant: props.variant,
|
||||
|
||||
Reference in New Issue
Block a user