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

Highlight <pre> in HTML block #296

Open
sbliven opened this issue Mar 2, 2021 · 3 comments
Open

Highlight <pre> in HTML block #296

sbliven opened this issue Mar 2, 2021 · 3 comments

Comments

@sbliven
Copy link

sbliven commented Mar 2, 2021

I sometimes prefer including code as a <pre> element within an HTML block rather than as a separate code block (for instance when embedding code in lists). Is there any way to trigger syntax highlighting in HTML blocks?

@westonruter
Copy link
Owner

It's possible. It would basically involve the same approach as extending for use in comments: #24 (comment).

@allejo
Copy link
Collaborator

allejo commented Jun 15, 2021

@westonruter should we add common functionality like this to the Wiki? Like have a section of filters that people can use on their websites?

@westonruter
Copy link
Owner

Yeah. I wonder though if we should make it a bit easier than what is currently involved in https://gist.github.com/westonruter/d35a909df087d90e0100d111eed77faa

Instead of calling our render_block() function, perhaps there should be a render() function that does most of what that filter_comment_text() function does.

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

No branches or pull requests

3 participants