From 4d9074aa03c76f0ef584fa786d8e9784f55e835d Mon Sep 17 00:00:00 2001 From: Ronald Tse Date: Wed, 15 Apr 2020 02:12:02 +0800 Subject: [PATCH] Use AsciiDoc stem expression for math --- lib/iev/termbase/term_builder.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/iev/termbase/term_builder.rb b/lib/iev/termbase/term_builder.rb index 44f130f..61a4b27 100644 --- a/lib/iev/termbase/term_builder.rb +++ b/lib/iev/termbase/term_builder.rb @@ -6,7 +6,7 @@ module Iev module Termbase class TermBuilder - NOTE_REGEX_1 = /Note[\s ]*\d+[\s ]to entry:\s+|Note[\s ]*\d+?[\s ]à l['’]article:\s+|?[\s ]*\d?[\s ]+.*?–\s+|NOTE[\s ]+-[\s ]+/i + NOTE_REGEX_1 = /Note[\s ]*\d+[\s ]to entry:\s+|Note[\s ]*\d+?[\s ]à l['’]article:[\s ]*|?[\s ]*\d?[\s ]+.*?–\s+|NOTE[\s ]+-[\s ]+/i NOTE_REGEX_2 = /\nNOTE\s+/ def initialize(data:, indices: ) @@ -199,7 +199,7 @@ def html_to_asciimath(input) case math_element.text.length when 1..8 # puts "(#{math_element.text} to => #{HTMLEntities.new.decode(math_element.text)})" - math_element.replace "$$#{HTMLEntities.new.decode(math_element.text)}$$" + math_element.replace "stem:[#{HTMLEntities.new.decode(math_element.text)}]" when 0 math_element.remove end @@ -228,7 +228,7 @@ def mathml_to_asciimath(input) if asciimath.empty? math_element.remove else - math_element.replace "$$#{asciimath}$$" + math_element.replace "stem:[#{asciimath}]" end end