Commit 256d2ae7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'rs-issue-2211' into 'master'

Update redcarpet to 3.2.3

Closes #2211

See merge request !1756
parents 6848312f 5a0ff2f5
......@@ -94,7 +94,7 @@ gem 'html-pipeline-gitlab', '~> 0.1'
gem "github-markup"
# Required markup gems by github-markdown
gem 'redcarpet', '~> 3.1.2'
gem 'redcarpet', '~> 3.2.3'
gem 'RedCloth'
gem 'rdoc', '~>3.6'
gem 'org-ruby', '= 0.9.12'
......
......@@ -457,7 +457,7 @@ GEM
ffi (>= 0.5.0)
rdoc (3.12.2)
json (~> 1.4)
redcarpet (3.1.2)
redcarpet (3.2.3)
redis (3.1.0)
redis-actionpack (4.0.0)
actionpack (~> 4)
......@@ -755,7 +755,7 @@ DEPENDENCIES
rb-fsevent
rb-inotify
rdoc (~> 3.6)
redcarpet (~> 3.1.2)
redcarpet (~> 3.2.3)
redis-rails
request_store
rspec-rails (= 2.99)
......
......@@ -31,15 +31,17 @@ module GitlabMarkdownHelper
def markdown(text, options={})
unless @markdown && options == @options
@options = options
gitlab_renderer = Redcarpet::Render::GitlabHTML.new(self,
user_color_scheme_class,
{
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
# 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, {
with_toc_data: true,
safe_links_only: true
safe_links_only: true,
# Handled further down the line by HTML::Pipeline::SanitizationFilter
escape_html: false
}.merge(options))
@markdown = Redcarpet::Markdown.new(gitlab_renderer,
# 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,
......@@ -47,8 +49,10 @@ module GitlabMarkdownHelper
strikethrough: true,
lax_spacing: true,
space_after_headers: true,
superscript: true)
superscript: true
)
end
@markdown.render(text).html_safe
end
......
......@@ -3,7 +3,7 @@ module Gitlab
class ReferenceExtractor
attr_accessor :users, :labels, :issues, :merge_requests, :snippets, :commits, :commit_ranges
include Markdown
include ::Gitlab::Markdown
def initialize
@users, @labels, @issues, @merge_requests, @snippets, @commits, @commit_ranges =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment