diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-10-07 12:20:07 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2016-10-07 12:20:07 +0300 |
commit | 9305670f16d296ea7690e6d7e4cff9d2ddbb76ca (patch) | |
tree | f86f81348f0250a144f4864d2db21b00514e7786 /lib | |
parent | 9de93e82c705f22d52dd42321f68a89c2b883653 (diff) |
Extend the regex to capture anchor links as well
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filters/markdown_to_html_ext.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/filters/markdown_to_html_ext.rb b/lib/filters/markdown_to_html_ext.rb index 51a35c09a..afb4fdee5 100644 --- a/lib/filters/markdown_to_html_ext.rb +++ b/lib/filters/markdown_to_html_ext.rb @@ -5,7 +5,7 @@ module Nanoc::Filters # Convert internal URLs that link to `.md` files to instead link to #{ }`.html` files since that's what Nanoc actually serves. def run(content, params = {}) - content.gsub(/href="(\S*.md)"/) do |result| # Fetch all links in the HTML Document + content.gsub(/href="(\S*.md\S*)"/) do |result| # Fetch all links in the HTML Document if /http/.match(result).nil? # Check if link is internal result.gsub!(/\.md/, '.html') # Replace the extension if link is internal end |