Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
distler committed Jul 23, 2022
1 parent 5887163 commit 97c0489
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/maruku/ext/math/parsing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ def is_math_enabled?
:regexp => RegEqref,
:handler => lambda do |doc, src, con|
return false unless doc.is_math_enabled?
eqid = src.read_regexp(RegEqref).captures.compact.first
foo = src.read_regexp(RegEqref)
return false unless foo
eqid = foo.captures.compact.first
con.push doc.md_el(:eqref, [], :eqid => eqid)
true
end)
Expand All @@ -111,7 +113,9 @@ def is_math_enabled?
:regexp => RegRef,
:handler => lambda do |doc, src, con|
return false unless doc.is_math_enabled?
refid = src.read_regexp(RegRef).captures.compact.first
foo = src.read_regexp(RegRef)
return false unless foo
refid = foo.captures.compact.first
con.push doc.md_el(:divref, [], :refid => refid)
true
end)
Expand All @@ -123,7 +127,9 @@ def is_math_enabled?
:regexp => RegCite,
:handler => lambda do |doc, src, con|
return false unless doc.is_math_enabled?
cites = src.read_regexp(RegCite).captures.compact.first.split(/\s*,\s*/)
foo = src.read_regexp(RegCite)
return false unless foo
cites = foo.captures.compact.first.split(/\s*,\s*/)
con.push doc.md_el(:citation, [], :cites => cites)
true
end)

0 comments on commit 97c0489

Please sign in to comment.