Merge pull request #455 from directus/Nitwel-patch-1

match <p></p> when inserting hint
This commit is contained in:
Rijk van Zanten
2020-09-30 13:08:16 -04:00
committed by GitHub

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 = /:::(.*?) (.*?)\n((\s|.)*?):::/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;
}
},