Skip to content

Instantly share code, notes, and snippets.

@BorisAnthony
Created July 27, 2020 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BorisAnthony/89a34ae67a84fd21e2717971482c6a9b to your computer and use it in GitHub Desktop.
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>
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
@BorisAnthony
Copy link
Author

The issue with this plugin currently is that any other markdown contained between == == is rendered un-converted to HTML.

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