Created
July 27, 2020 12:38
-
-
Save BorisAnthony/89a34ae67a84fd21e2717971482c6a9b to your computer and use it in GitHub Desktop.
A first attempt at a little Jekyll plugin to parse ==text== into <mark>text</mark>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HighlightsGenerator < Jekyll::Generator | |
def generate(site) | |
all_docs = site.documents | |
# Converts Markdown-plus ==text== to <mark>text</mark> | |
all_docs.each do |current_note| | |
current_note.content = current_note.content.gsub( | |
/\=\=(.*)\=\=/i, | |
'<mark>\1</mark>' | |
) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue with this plugin currently is that any other markdown contained between == == is rendered un-converted to HTML.