Escaping pipes in the code of table elements

ref. https://github.github.com/gfm/#example-200
This commit is contained in:
dearblue
2022-12-03 14:40:30 +09:00
parent 5f3aed7413
commit 32d48a5f0e
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -34,6 +34,7 @@ module MRuby
cmt.sub!(/\s*#.*/, "")
cmt.sub!(/\b(?=L_\w+\b)/, "OP_")
cmt.gsub!(/\b(Irep|Pool|R|Syms)\[([^\[\]]+)\]/, "\\1(\\2)")
cmt.gsub!(/[\\\|]/) { |m| "\\#{m}" } # Ruby-2.5 is not support "Numbered block parameter"
end
spec = opspecs[opr] or raise "unknown operand type: #{opr}"
item = format(%(| %-18s | %-14s | %-58s |\n), "`OP_#{ins}`", "`#{spec[:modified] || opr}`", cmt && "`#{cmt}`")