Commit c064aed7 authored by Stan Hu's avatar Stan Hu

Remove Kramdown patch and update to v2.3.1 gem

As of https://gitlab.com/gitlab-org/gitlab/-/merge_requests/56750,
Markdown should no longer be rendered through Kramdown for Wiki
pages. The monkey patch can be removed with Kramdown v2.3.1.

Diff:
https://my.diffend.io/gems/kramdown/2.3.0/2.3.1
parent 83b2d4b1
...@@ -150,7 +150,7 @@ gem 'deckar01-task_list', '2.3.1' ...@@ -150,7 +150,7 @@ gem 'deckar01-task_list', '2.3.1'
gem 'gitlab-markup', '~> 1.7.1' gem 'gitlab-markup', '~> 1.7.1'
gem 'github-markup', '~> 1.7.0', require: 'github/markup' gem 'github-markup', '~> 1.7.0', require: 'github/markup'
gem 'commonmarker', '~> 0.21' gem 'commonmarker', '~> 0.21'
gem 'kramdown', '~> 2.3.0' gem 'kramdown', '~> 2.3.1'
gem 'RedCloth', '~> 4.3.2' gem 'RedCloth', '~> 4.3.2'
gem 'rdoc', '~> 6.1.2' gem 'rdoc', '~> 6.1.2'
gem 'org-ruby', '~> 0.9.12' gem 'org-ruby', '~> 0.9.12'
......
...@@ -669,7 +669,7 @@ GEM ...@@ -669,7 +669,7 @@ GEM
kgio (2.11.3) kgio (2.11.3)
knapsack (1.17.0) knapsack (1.17.0)
rake rake
kramdown (2.3.0) kramdown (2.3.1)
rexml rexml
kramdown-parser-gfm (1.1.0) kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0) kramdown (~> 2.0)
...@@ -1471,7 +1471,7 @@ DEPENDENCIES ...@@ -1471,7 +1471,7 @@ DEPENDENCIES
jwt (~> 2.1.0) jwt (~> 2.1.0)
kaminari (~> 1.0) kaminari (~> 1.0)
knapsack (~> 1.17) knapsack (~> 1.17)
kramdown (~> 2.3.0) kramdown (~> 2.3.1)
kubeclient (~> 4.9.1) kubeclient (~> 4.9.1)
lefthook (~> 0.7) lefthook (~> 0.7)
letter_opener_web (~> 1.3.4) letter_opener_web (~> 1.3.4)
......
---
title: Remove Kramdown patch and update to v2.3.1 gem
merge_request: 56917
author:
type: fixed
# frozen_string_literal: true
#
# This pulls in https://github.com/gettalong/kramdown/pull/708 for kramdown v2.3.0.
# Remove this file when that pull request is merged and released.
require 'kramdown/converter'
require 'kramdown/converter/syntax_highlighter/rouge'
module Kramdown::Converter::SyntaxHighlighter
module Rouge
def self.formatter_class(opts = {})
case formatter = opts[:formatter]
when Class
formatter
when /\A[[:upper:]][[:alnum:]_]*\z/
::Rouge::Formatters.const_get(formatter, false)
else
# Available in Rouge 2.0 or later
::Rouge::Formatters::HTMLLegacy
end
rescue NameError
# Fallback to Rouge 1.x
::Rouge::Formatters::HTML
end
end
end
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe 'Kramdown patch for syntax highlighting formatters' do RSpec.describe 'Ensure kramdown detects invalid syntax highlighting formatters' do
subject { Kramdown::Document.new(options + "\n" + code).to_html } subject { Kramdown::Document.new(options + "\n" + code).to_html }
let(:code) do let(:code) do
......
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