Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-01-31 11:58:23 +0300
committerJan Provaznik <jprovaznik@gitlab.com>2019-02-04 14:48:35 +0300
commitb2c70230b35e72826f55acfd6b44bfabd19302bb (patch)
tree66d214c65e256034f53c4497c5b65fbd9c8494df /app/models/concerns/cache_markdown_field.rb
parentb9f0eff9fc72e891e2ccf910b3fcd52539bc48fb (diff)
Remove Redcarpet markdown engine
This engine was replaced with CommonMarker in 11.4, it was deprecated since then.
Diffstat (limited to 'app/models/concerns/cache_markdown_field.rb')
-rw-r--r--app/models/concerns/cache_markdown_field.rb27
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