Skip to content

Commit

Permalink
Use AsciiDoc stem expression for math
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Apr 14, 2020
1 parent e6aeaa7 commit 4d9074a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/iev/termbase/term_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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+|<NOTE\/?>?[\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 ]*|<NOTE\/?>?[\s ]*\d?[\s ]+.*?–\s+|NOTE[\s ]+-[\s ]+/i
NOTE_REGEX_2 = /\nNOTE\s+/

def initialize(data:, indices: )
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 4d9074a

Please sign in to comment.