lib/md2man/document.rb in md2man-3.0.0 vs lib/md2man/document.rb in md2man-3.0.1
- old
+ new
@@ -72,22 +72,22 @@
end
private
def encode_references text
- # the [^\n\S] captures all non-newline whitespace
- # basically, it's meant to be \s but excluding \n
text.gsub(/(?<page>[\w\-\.]+)\((?<section>\w+)\)/) do
match = $~
key = encode(match)
@references[key] = match
key
end
end
def decode_references text
@references.delete_if do |key, match|
- text.sub! /#{Regexp.escape key}(?<addendum>\S*[^\n\S]*)/ do
+ # the [^\S\n] captures all non-newline whitespace
+ # basically, it's meant to be \s but excluding \n
+ text.sub! /#{Regexp.escape key}(?<addendum>\S*[^\S\n]*)/ do
reference match, $~
end
end
text
end