Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax highlighting is weird in :reader #4931

Open
hejops opened this issue Feb 22, 2024 · 0 comments
Open

Syntax highlighting is weird in :reader #4931

hejops opened this issue Feb 22, 2024 · 0 comments

Comments

@hejops
Copy link
Contributor

hejops commented Feb 22, 2024

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants