Unverified Commit 8ce914ee authored by willmeek's avatar willmeek Committed by GitHub

Merge pull request #176 from eputnam/pdoc36

(PDOC-36) fix hack for README urls
parents 2ec1b240 5d2c4411
......@@ -24,7 +24,7 @@ module PuppetStrings::Yard::Util
# @return [String] HTML document with links converted
def self.github_to_yard_links(data)
data.scan(/href\=\"\#(.+)\"/).each do |bad_link|
data.gsub!(bad_link.first, "label-#{bad_link.first.capitalize.gsub('-', '+')}")
data.gsub!("=\"##{bad_link.first}\"", "=\"#label-#{bad_link.first.capitalize.gsub('-', '+')}\"")
end
data
end
......
......@@ -39,5 +39,10 @@ STR
str = '<a href="www.github.com/blah/document.html#module-description">'
expect(subject.github_to_yard_links(str)).to eq(str)
end
it 'leaves plain text alone' do
str = '<a href="#module-description"> module-description'
expect(subject.github_to_yard_links(str)).to eq('<a href="#label-Module+description"> module-description')
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment