diff --git a/lib/iev.rb b/lib/iev.rb index de44c9e..bfcff71 100644 --- a/lib/iev.rb +++ b/lib/iev.rb @@ -43,7 +43,7 @@ def self.get(code, lang) a = doc&.at(xpath)&.children&.to_xml a&.sub(%r{
.*$}, "") &.sub(%r{, <.*$}, "") - &.gsub(%r{<[^>]*>}, "")&.strip + &.gsub(%r{<[^<>]*>}, "")&.strip end end diff --git a/lib/iev/utilities.rb b/lib/iev/utilities.rb index 3be3733..bd6645a 100644 --- a/lib/iev/utilities.rb +++ b/lib/iev/utilities.rb @@ -27,7 +27,7 @@ def parse_anchor_tag(text, term_domain) /(.*?)$/, '{{\3, IEV:\2}}', ).gsub( - /(.*?)<\/a>/, + /(.*?)<\/a>/, '\1[\2]', ).gsub( Regexp.new([SIMG_PATH_REGEX, "\\s*", FIGURE_TWO_REGEX].join), @@ -36,7 +36,7 @@ def parse_anchor_tag(text, term_domain) Regexp.new([SIMG_PATH_REGEX, "\\s*", FIGURE_ONE_REGEX].join), "#{IMAGE_PATH_PREFIX}/#{term_domain}/\\1[Figure \\2 - \\3]", ).gsub( - //, + /]+?)\s*>/, "#{IMAGE_PATH_PREFIX}/#{term_domain}/\\1[]", ).gsub( /
/,