Skip to content

Commit

Permalink
Fixed FrozenError
Browse files Browse the repository at this point in the history
In some documents, latexmath will appear in text passed to `handle_inline_stem` as a frozen string.

By changing line 135 to include `text = text.gsub(stem_rx)` instead of `text.gsub!(stem_rx)`, this error no longer occurs.
  • Loading branch information
bwittman committed May 16, 2019
1 parent 242e250 commit e26c6ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/asciidoctor-mathematical/extension.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def handle_inline_stem(node, text, mathematical, image_output_dir, image_target_

source_modified = false
# TODO skip passthroughs in the source (e.g., +stem:[x^2]+)
text.gsub!(stem_rx) {
text = text.gsub(stem_rx) {
if (m = $~)[0].start_with? '\\'
next m[0][1..-1]
end
Expand Down

0 comments on commit e26c6ba

Please sign in to comment.