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

Add Markdown support to convert == / :: to <mark> #551

Merged
merged 2 commits into from
May 15, 2022

Conversation

jaredcwhite
Copy link
Member

Many Markdown editors allow you to highlight text with ::double colons:: or with ==double equals==. I've grown accustomed to this myself in various writing contexts. Because of that, it's frustrating to have to switch gears in Bridgetown .md files and add <mark> tags everywhere instead.

This PR patches Kramdown's GFM parser (our default) to add support for both those delimiters. So for example:

This is ==now highlighted==! ::Yay!::

becomes

This is <mark>now highlighted</mark>! <mark>Yay!</mark>

The kramdown: mark_highlighting YAML config option can be set to false to disable this new feature if for some reason it's a breaking change for existing websites.

@jaredcwhite jaredcwhite added the enhancement New feature or request label May 11, 2022
@jaredcwhite jaredcwhite added this to the 1.1 milestone May 11, 2022
@render
Copy link

render bot commented May 11, 2022

@render
Copy link

render bot commented May 11, 2022

@jaredcwhite
Copy link
Member Author

jaredcwhite commented May 11, 2022

(Note: before merging might want to look into patching the base Kramdown parser instead of GFM…)

Can't do that because the GFM initializer hardcodes all the block and span definitions. 🤷

@jaredcwhite jaredcwhite merged commit 33304fa into main May 15, 2022
@jaredcwhite jaredcwhite deleted the add-mark-highlighting-to-markdown branch May 15, 2022 18:38
@andrewmcodes
Copy link
Contributor

Was just starting to build a regex to do this so 🎉 Great addition! 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants