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' ...@@ -94,7 +94,7 @@ gem 'html-pipeline-gitlab', '~> 0.1'
gem "github-markup" gem "github-markup"
# Required markup gems by github-markdown # Required markup gems by github-markdown
gem 'redcarpet', '~> 3.1.2' gem 'redcarpet', '~> 3.2.3'
gem 'RedCloth' gem 'RedCloth'
gem 'rdoc', '~>3.6' gem 'rdoc', '~>3.6'
gem 'org-ruby', '= 0.9.12' gem 'org-ruby', '= 0.9.12'
......
...@@ -457,7 +457,7 @@ GEM ...@@ -457,7 +457,7 @@ GEM
ffi (>= 0.5.0) ffi (>= 0.5.0)
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
redcarpet (3.1.2) redcarpet (3.2.3)
redis (3.1.0) redis (3.1.0)
redis-actionpack (4.0.0) redis-actionpack (4.0.0)
actionpack (~> 4) actionpack (~> 4)
...@@ -755,7 +755,7 @@ DEPENDENCIES ...@@ -755,7 +755,7 @@ DEPENDENCIES
rb-fsevent rb-fsevent
rb-inotify rb-inotify
rdoc (~> 3.6) rdoc (~> 3.6)
redcarpet (~> 3.1.2) redcarpet (~> 3.2.3)
redis-rails redis-rails
request_store request_store
rspec-rails (= 2.99) rspec-rails (= 2.99)
......
...@@ -31,15 +31,17 @@ module GitlabMarkdownHelper ...@@ -31,15 +31,17 @@ module GitlabMarkdownHelper
def markdown(text, options={}) def markdown(text, options={})
unless @markdown && options == @options unless @markdown && options == @options
@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
{ rend = Redcarpet::Render::GitlabHTML.new(self, user_color_scheme_class, {
# see https://github.com/vmg/redcarpet#darling-i-packed-you-a-couple-renderers-for-lunch-
with_toc_data: true, 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)) }.merge(options))
@markdown = Redcarpet::Markdown.new(gitlab_renderer,
# see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use # see https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use
@markdown = Redcarpet::Markdown.new(rend,
no_intra_emphasis: true, no_intra_emphasis: true,
tables: true, tables: true,
fenced_code_blocks: true, fenced_code_blocks: true,
...@@ -47,8 +49,10 @@ module GitlabMarkdownHelper ...@@ -47,8 +49,10 @@ module GitlabMarkdownHelper
strikethrough: true, strikethrough: true,
lax_spacing: true, lax_spacing: true,
space_after_headers: true, space_after_headers: true,
superscript: true) superscript: true
)
end end
@markdown.render(text).html_safe @markdown.render(text).html_safe
end end
......
...@@ -3,7 +3,7 @@ module Gitlab ...@@ -3,7 +3,7 @@ module Gitlab
class ReferenceExtractor class ReferenceExtractor
attr_accessor :users, :labels, :issues, :merge_requests, :snippets, :commits, :commit_ranges attr_accessor :users, :labels, :issues, :merge_requests, :snippets, :commits, :commit_ranges
include Markdown include ::Gitlab::Markdown
def initialize def initialize
@users, @labels, @issues, @merge_requests, @snippets, @commits, @commit_ranges = @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