Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/Rules
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-11-10 01:58:57 +0300
committerConnor Shea <connor.james.shea@gmail.com>2016-11-10 01:58:57 +0300
commit8e56bab9577d1e0b13f83ff0527b5b579b12fdca (patch)
tree5b63ce82684ed069da6e083e923b041c1eb2c145 /Rules
parent50e5f86289155b146dd821cd754dbea2c977ae4f (diff)
Enable autolinking in Redcarpet. Fixes #37.
Diffstat (limited to 'Rules')
-rw-r--r--Rules7
1 files changed, 4 insertions, 3 deletions
diff --git a/Rules b/Rules
index a7c97606..92925805 100644
--- a/Rules
+++ b/Rules
@@ -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