summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-27 06:26:22 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-27 06:26:22 +0000
commite918ae240ee860c9126f537bbee38a1e92cb7508 (patch)
tree03789811b6f4251915d48ff2720b9ebe470f68a9 /lib
parent7c5d96cf5247e5f9a78c55d0ed8e8ccb92f016d2 (diff)
parent281643a1bfd6f4da88a278bfce20133c80105de5 (diff)
downloadgitlab-ce-e918ae240ee860c9126f537bbee38a1e92cb7508.tar.gz
Merge branch 'no_link_inside_code_block' into 'master'
No link inside code block
Diffstat (limited to 'lib')
-rw-r--r--lib/redcarpet/render/gitlab_html.rb21
1 files changed, 3 insertions, 18 deletions
diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb
index 7d9428ff27d..bb225f1acd8 100644
--- a/lib/redcarpet/render/gitlab_html.rb
+++ b/lib/redcarpet/render/gitlab_html.rb
@@ -6,8 +6,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
def initialize(template, options = {})
@template = template
@project = @template.instance_variable_get("@project")
- @ref = @template.instance_variable_get("@ref")
- @request_path = @template.instance_variable_get("@path")
@options = options.dup
super options
end
@@ -45,23 +43,10 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end
end
- def preprocess(full_document)
- if is_wiki?
- full_document
- elsif @project
- h.create_relative_links(full_document, @project, @ref, @request_path)
- else
- full_document
- end
- end
-
def postprocess(full_document)
- h.gfm(full_document)
- end
-
- def is_wiki?
- if @template.instance_variable_get("@project_wiki")
- @template.instance_variable_get("@page")
+ unless @template.instance_variable_get("@project_wiki") || @project.nil?
+ full_document = h.create_relative_links(full_document)
end
+ h.gfm(full_document)
end
end