Re-enable hiding LaTeX

Signed-off-by: Danila Fedorin <danila.fedorin@gmail.com>
This commit is contained in:
2026-01-03 16:34:57 -08:00
parent 7a088d6739
commit ccc8d6f0eb
2 changed files with 6 additions and 7 deletions

View File

@@ -68,13 +68,12 @@ files.each do |file|
t.replace(rendered)
end
found_any ||= document.at('meta[name="needs-latex"]')
# If we didn't find any mathematical equations, no need to include KaTeX CSS.
# 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
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