Skip to content

Commit

Permalink
use x01 for escape placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuto committed Nov 16, 2017
1 parent a2fd636 commit 7c73677
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/review/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ def compile_single(syntax, args)
def replace_fence(str)
str.gsub(/@<(\w+)>([$|])(.+?)(\2)/) do
op = $1
arg = $3.gsub('@', '!!!atmark!!!').gsub('\\}') { '\\\\}' }.gsub('}') { '\}' }.sub(/(?:\\)+$/) { |m| '\\\\' * m.size }
arg = $3.gsub('@', "\x01").gsub('\\}') { '\\\\}' }.gsub('}') { '\}' }.sub(/(?:\\)+$/) { |m| '\\\\' * m.size }
"@<#{op}>{#{arg}}"
end
end
Expand All @@ -522,7 +522,7 @@ def text(str)
result << compile_inline(words.shift.gsub(/\\\}/, '}').gsub(/\\\\/, '\\'))
result << @strategy.nofunc_text(words.shift)
end
result.gsub('!!!atmark!!!', '@')
result.gsub("\x01", '@')
rescue => err
error err.message
end
Expand Down

0 comments on commit 7c73677

Please sign in to comment.