Commit bc549712 authored by Francisco Javier López's avatar Francisco Javier López

Merge branch 'sh-remove-kramdown-patch' into 'master'

Remove Kramdown patch and update to v2.3.1 gem

See merge request gitlab-org/gitlab!56917
parents 76ebd961 c064aed7
......@@ -150,7 +150,7 @@ gem 'deckar01-task_list', '2.3.1'
gem 'gitlab-markup', '~> 1.7.1'
gem 'github-markup', '~> 1.7.0', require: 'github/markup'
gem 'commonmarker', '~> 0.21'
gem 'kramdown', '~> 2.3.0'
gem 'kramdown', '~> 2.3.1'
gem 'RedCloth', '~> 4.3.2'
gem 'rdoc', '~> 6.1.2'
gem 'org-ruby', '~> 0.9.12'
......
......@@ -669,7 +669,7 @@ GEM
kgio (2.11.3)
knapsack (1.17.0)
rake
kramdown (2.3.0)
kramdown (2.3.1)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
......@@ -1471,7 +1471,7 @@ DEPENDENCIES
jwt (~> 2.1.0)
kaminari (~> 1.0)
knapsack (~> 1.17)
kramdown (~> 2.3.0)
kramdown (~> 2.3.1)
kubeclient (~> 4.9.1)
lefthook (~> 0.7)
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 @@
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 }
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