fix(Highlight): remove <hidden> tags in code examples

This commit is contained in:
mei (ckie) 2024-10-23 21:48:43 +03:00
parent 5f9c951db4
commit 7fc3f406dd
Signed by untrusted user: ckie
GPG key ID: 13E79449C0525215

View file

@ -8,7 +8,9 @@
export let alt;
let renderedCode;
$: renderedCode = slice ? code.replace(/#<hidden>[^]*?#<\/hidden>/, "") : code;
$: renderedCode =
slice ? code.replace(/#<hidden>[^]*?#<\/hidden>/, "")
: code.replace(/#(<hidden>|<\/hidden>)/g,"");
</script>
<p class="sr-only">{alt}</p>