This commit is contained in:
Danila Fedorin 2020-12-14 19:16:47 -08:00
commit f57cb7273d

View File

@ -29,7 +29,7 @@ inline_cache, display_cache = {}, {}
files.each do |file| files.each do |file|
puts "Rendering file: #{file}" puts "Rendering file: #{file}"
document = Nokogiri::HTML.parse(File.open(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)) t.replace(perform_katex_sub(inline_cache, display_cache, t.content))
end end
File.write(file, document.to_html) File.write(file, document.to_html)