diff --git a/convert.rb b/convert.rb index e3875df..94e292c 100644 --- a/convert.rb +++ b/convert.rb @@ -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 diff --git a/themes/vanilla b/themes/vanilla index 952502e..54e942c 160000 --- a/themes/vanilla +++ b/themes/vanilla @@ -1 +1 @@ -Subproject commit 952502e6907c04a71c0b6b1954df2b81fb72ec9f +Subproject commit 54e942c85f9579b7dd2ba7402642198b0697fa1b