lib/reverse_markdown/converters/base.rb in reverse_markdown-1.0.0 vs lib/reverse_markdown/converters/base.rb in reverse_markdown-1.0.1
- old
+ new
@@ -10,10 +10,10 @@
def treat(node, state)
ReverseMarkdown::Converters.lookup(node.name).convert(node, state)
end
def escape_keychars(string)
- string.gsub(/[\*\_]/, '*' => '\*', '_' => '\_')
+ string.gsub(/(?<!\\)[*_]/, '*' => '\*', '_' => '\_')
end
def extract_title(node)
title = escape_keychars(node['title'].to_s)
title.empty? ? '' : %[ "#{title}"]