Open mckbrchill opened 1 year ago
Yep, it's because the code block is nested inside list item, moreover in my case this list item also has subtokens (item.tokens) and code token is one of them, so unsanitizeMd doesn't touch it. Also because of that the code is rendered as a default markdown without language highlighting.
upd.: seems that some universal in-depth traversing through all token.items for list and token.tokens for list items and other tokens if there are any can fix the problem, but I don't know how to properly implement it
Thanks for reporting this, I guess indeed we need some kind of recursive traversing of tokens, not sure how that would work 🤔
I noticed that "$lt;" still occurs in the code blocks
It seems it happens when the code block is in list token parsed by marked library. So it falls into else statement here, because token.type == list, and it contains code inside: