summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-02 18:39:18 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-06-02 18:39:18 +0000
commit79aac2c128e0c2fa8fd657af273fbd219002f39c (patch)
treebe65a8f1a10fc6f99d7de160e11a679ff549dee5 /app
parent34d176ad577ea421c99c87a54196deda92f796e8 (diff)
parenta916936f3feeda0a6d58fef2c06c51f95f10c45a (diff)
downloadgitlab-ce-79aac2c128e0c2fa8fd657af273fbd219002f39c.tar.gz
Merge branch 'ignore-references' into 'master'
Don't notify users mentioned in code blocks or blockquotes. cc @rspeicher See merge request !753
Diffstat (limited to 'app')
-rw-r--r--app/helpers/gitlab_markdown_helper.rb27
1 files changed, 12 insertions, 15 deletions
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 3c207619adf..2777944fc9d 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -41,29 +41,26 @@ module GitlabMarkdownHelper
fragment.to_html.html_safe
end
+ MARKDOWN_OPTIONS = {
+ no_intra_emphasis: true,
+ tables: true,
+ fenced_code_blocks: true,
+ strikethrough: true,
+ lax_spacing: true,
+ space_after_headers: true,
+ superscript: true,
+ footnotes: true
+ }.freeze
+
def markdown(text, options={})
unless @markdown && options == @options
@options = options
- options.merge!(
- # Handled further down the line by Gitlab::Markdown::SanitizationFilter
- escape_html: false
- )
-
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch
rend = Redcarpet::Render::GitlabHTML.new(self, user_color_scheme_class, options)
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
- @markdown = Redcarpet::Markdown.new(rend,
- no_intra_emphasis: true,
- tables: true,
- fenced_code_blocks: true,
- strikethrough: true,
- lax_spacing: true,
- space_after_headers: true,
- superscript: true,
- footnotes: true
- )
+ @markdown = Redcarpet::Markdown.new(rend, MARKDOWN_OPTIONS)
end
@markdown.render(text).html_safe