diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-05 13:23:28 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-02-05 13:23:28 +0000 |
commit | fedecbbe01f56897620ba56182c57e592e2cd6ac (patch) | |
tree | bb86c40197170113216a253d88f0228afb65701d /app/models/concerns | |
parent | fb296ab57128f2da25e69cd8453fed86bf44748d (diff) | |
parent | b2c70230b35e72826f55acfd6b44bfabd19302bb (diff) | |
download | gitlab-ce-fedecbbe01f56897620ba56182c57e592e2cd6ac.tar.gz |
Merge branch 'jprovazn-remove-redcarpet' into 'master'
Remove Redcarpet markdown engine
Closes #51374
See merge request gitlab-org/gitlab-ce!24819
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/cache_markdown_field.rb | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb index 588204c7470..5fa6f79bdaa 100644 --- a/app/models/concerns/cache_markdown_field.rb +++ b/app/models/concerns/cache_markdown_field.rb @@ -13,7 +13,6 @@ module CacheMarkdownField extend ActiveSupport::Concern # Increment this number every time the renderer changes its output - CACHE_REDCARPET_VERSION = 3 CACHE_COMMONMARK_VERSION_START = 10 CACHE_COMMONMARK_VERSION = 14 @@ -42,18 +41,6 @@ module CacheMarkdownField end end - class MarkdownEngine - def self.from_version(version = nil) - return :common_mark if version.nil? || version == 0 - - if version < CacheMarkdownField::CACHE_COMMONMARK_VERSION_START - :redcarpet - else - :common_mark - end - end - end - def skip_project_check? false end @@ -71,7 +58,7 @@ module CacheMarkdownField # Banzai is less strict about authors, so don't always have an author key context[:author] = self.author if self.respond_to?(:author) - context[:markdown_engine] = MarkdownEngine.from_version(latest_cached_markdown_version) + context[:markdown_engine] = :common_mark context end @@ -128,17 +115,7 @@ module CacheMarkdownField end def latest_cached_markdown_version - return CacheMarkdownField::CACHE_COMMONMARK_VERSION unless cached_markdown_version - - if legacy_markdown? - CacheMarkdownField::CACHE_REDCARPET_VERSION - else - CacheMarkdownField::CACHE_COMMONMARK_VERSION - end - end - - def legacy_markdown? - cached_markdown_version && cached_markdown_version.between?(1, CacheMarkdownField::CACHE_COMMONMARK_VERSION_START - 1) + CacheMarkdownField::CACHE_COMMONMARK_VERSION end included do |