Initial commit

This commit is contained in:
Łukasz Skotarek 2023-01-05 19:02:49 +01:00 committed by GitHub
commit fa52922077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 1802 additions and 0 deletions

View file

@ -0,0 +1,18 @@
# frozen_string_literal: true
# Turns ==something== in Markdown to <mark>something</mark> in output HTML
Jekyll::Hooks.register [:notes], :post_convert do |doc|
replace(doc)
end
Jekyll::Hooks.register [:pages], :post_convert do |doc|
# jekyll considers anything at the root as a page,
# we only want to consider actual pages
next unless doc.path.start_with?('_pages/')
replace(doc)
end
def replace(doc)
doc.content.gsub!(/==+([^ ](.*?)?[^ .=]?)==+/, "<mark>\\1</mark>")
end