Skip to content

Commit

Permalink
fix: unable to use cases extension of mathjax (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreytse committed Sep 22, 2021
1 parent 4c34f48 commit a9a7452
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/jekyll-spaceship/processors/mathjax-processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def on_handle_markdown(content)
escaped_expr = expr
.gsub(/(?<!^)\\(?!\S$)/, '\\\\\\\\')
.gsub(/(?<!\\)\$\$/, '\\\$\\\$')
.gsub(/\\\\(?=\s)/, '\\\\\\\\\\')
.gsub(/\\ /, '\\\\\\ ')
content = content.gsub(expr, escaped_expr)
end
Expand Down Expand Up @@ -92,7 +93,7 @@ def get_math_patterns()
r&.each do |i|
btag = Regexp.escape(i[0])
etag = Regexp.escape(i[1])
patterns <<= /((?<!\\\\)#{btag}(.*?)(?<!\\\\)#{etag})/
patterns <<= /((?<!\\\\)#{btag}([\s\S]*?)(?<!\\\\)#{etag})/
end
end
end
Expand Down

0 comments on commit a9a7452

Please sign in to comment.