diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-11-10 01:58:57 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-11-10 01:58:57 +0300 |
commit | 8e56bab9577d1e0b13f83ff0527b5b579b12fdca (patch) | |
tree | 5b63ce82684ed069da6e083e923b041c1eb2c145 /Rules | |
parent | 50e5f86289155b146dd821cd754dbea2c977ae4f (diff) |
Enable autolinking in Redcarpet. Fixes #37.
Diffstat (limited to 'Rules')
-rw-r--r-- | Rules | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -5,13 +5,13 @@ preprocess do if item.identifier.to_s.end_with?(".md") && !item.binary? begin # If the page is a redirect, make it a redirect. - if item.raw_content =~ /^This document was moved to \[.*\]\(.*\)/mu + if item.raw_content =~ /^This document was moved to \[.*\]\(.*\)/m # Capture the intended page so the redirect page can redirect to it. item[:redirect] = item.raw_content.match(/^This document was moved to \[.*\]\((.*)\)/m)[1] # Correct the URL. item[:redirect] = item[:redirect].gsub!(/\.md/, '.html') end - + title = item.raw_content.match(/^[#] .*$/).to_s title.gsub!('# ', '') item[:title] = title unless title.empty? @@ -47,7 +47,8 @@ compile '/**/*.md' do space_after_headers: true, strikethrough: true, superscript: true, - tables: true + tables: true, + autolink: true }, renderer_options: { with_toc_data: true |