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

Highlighting text with the <mark> element #61

Open
srid opened this issue Oct 18, 2020 · 2 comments
Open

Highlighting text with the <mark> element #61

srid opened this issue Oct 18, 2020 · 2 comments

Comments

@srid
Copy link

srid commented Oct 18, 2020

Would this be an acceptable extension to contribute in order to support highlighting of inline elements using the HTML <mark>?

Hello world; ==this part of the sentence== is highlighted in yellow due to use of the `<mark` tag

It seems to require a change to Pandoc, by adding a new Inline constructor, similar to Superscript, which I would be happy to contribute too.

cf. https://talk.commonmark.org/t/highlighting-text-with-the-mark-element/840

@jgm
Copy link
Owner

jgm commented Oct 19, 2020

Anything that involves a change to the pandoc AST is very involved. Changes would be required not just to pandoc-types, but to the majority of modules in pandoc. We are generally very conservative about such changes.

One option that works with current pandoc is to use a bracketed span with attributes, [this text is highlighted]{.highlight}, and converting it to RawInline (Format "html") "<mark>", innercontents, RawInline (Format "html") "</mark>" using a filter, if the target format is HTML5 (check global FORMAT in a lua filter).

@jgm
Copy link
Owner

jgm commented Oct 19, 2020

I'd consider a syntax extension for == in commonmark-extensions -- since this is started to get wider support -- but the pandoc change would be more controversial.

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

2 participants