From f3b5f884edef640e1b82848046185eee4bd83687 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 2 Nov 2020 08:02:24 +0000 Subject: [PATCH] Be careful to replace math in proper spots. --- blog/convert.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blog/convert.rb b/blog/convert.rb index 697dc2d..bb74a36 100644 --- a/blog/convert.rb +++ b/blog/convert.rb @@ -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)