Be careful to replace math in proper spots.

This commit is contained in:
Danila Fedorin 2020-11-02 08:02:24 +00:00
parent 07f0596f6e
commit f3b5f884ed

View File

@ -28,7 +28,7 @@ inline_cache, display_cache = {}, {}
files.each do |file|
puts "Rendering file: #{file}"
document = Nokogiri::HTML.parse(File.open(file))
document.search('//*[not(self::code)]/text()').each do |t|
document.search('//*[not(ancestor-or-self::code)]/text()').each do |t|
t.replace(perform_katex_sub(inline_cache, display_cache, t.content))
end
File.write(file, document.to_html)