There was an error while loading. Please reload this page.
1 parent 901eeae commit 6886bcaCopy full SHA for 6886bca
1 file changed
components/Molecules/MarkedWrapper.vue
@@ -16,22 +16,9 @@ export default {
16
required: true,
17
},
18
19
- methods: {
20
- // Replace (#item1) → <a id="item1"></a>
21
- convertAnchors(md) {
22
- // Match all (#something) patterns that are *not part of a markdown link*
23
- // Negative lookbehind avoids touching [text](#itemX)
24
- return md.replace(
25
- /(?<!\[.*?)\(#([\w-]+)\)(?!\))/g,
26
- (_match, id) => `<a id="${id}"></a>`
27
- );
28
- },
29
30
computed: {
31
markup() {
32
- const processed = this.convertAnchors(this.markdown);
33
- const html = marked(processed);
34
- return DOMPurify.sanitize(html);
+ return DOMPurify.sanitize(marked(this.markdown));
35
36
37
};
0 commit comments