Keep KaTeX css files

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
Danila Fedorin 2025-02-23 17:01:49 -08:00
parent 647f47a5f3
commit 06e8b8e022

View File

@ -69,9 +69,12 @@ files.each do |file|
end
# If we didn't find any mathematical equations, no need to include KaTeX CSS.
unless found_any
document.css('link[href$="katex.css"], link[href$="katex.min.css"]').each(&:remove)
end
# Disabled here because Bergamot technically doesn't require math blocks
# on the page but does need the CSS.
#
# unless found_any
# document.css('link[href$="katex.css"], link[href$="katex.min.css"]').each(&:remove)
# end
File.write(file, document.to_html(encoding: 'UTF-8'))
end