tridactyl/tridactyl

Syntax highlighting is weird in :reader

Opened this issue · 0 comments

Here's an example where the default CSS style applied when calling :reader leads to funky syntax highlighting. I wonder if it's possible to use CSS to preserve syntax highlighting in code blocks, or strip all colours entirely (kind of like the builtin reader does).

Maybe we could do something to content or document.body here? I might consider doing something like this.

tridactyl/src/reader.ts

Lines 8 to 11 in 9954b8f

article.content = xss(article.content, { stripIgnoreTag: true })
const content = document.createElement("main")
content.innerHTML = article.content
document.body.appendChild(content)