Insert tip before generating html

This commit is contained in:
Nitwel
2020-09-30 18:10:58 +02:00
committed by GitHub
parent cefd8f1847
commit b59931e3b4

View File

@@ -23,12 +23,10 @@ export default defineComponent({
html.value = '';
return;
}
let htmlString = marked(slots.default()[0].text!, {
highlight: (code) => highlight.highlightAuto(code).value,
});
const hintRegex = /<p>:::(.*?) (.*?)\n((\s|.)*?):::<\/p>/gm;
let htmlString = slots.default()[0].text!
const hintRegex = /:::(.*?) (.*?)\r?\n((\s|.)*?):::/gm;
htmlString = htmlString.replaceAll(
hintRegex,
@@ -37,6 +35,10 @@ export default defineComponent({
}
);
let htmlString = marked(htmlString, {
highlight: (code) => highlight.highlightAuto(code).value,
});
html.value = htmlString;
}
},