#<script> not picking up on transformed markdown

2 messages · Page 1 of 1 (latest)

rare eagle
#

hi, i have a json file with some markdown code, i use Shiki to transform it and add it to the html result of marked.parse(), i also have a <script> that then has search through the <pre> element and find every <span> tag

however, even though the html shows up properly with Shiki highlighted codeblocks, the script doesn't see the <span>s, and if i console.log the pre element - i get the raw code that i'd see if the codeblock wasn't parsed by Shiki

please help

rare eagle
#

i have successfully fixed it by timing out the script, dunno if that's the best solution but if it works - it works