From 879628c8260b2b5813ce4d90a01a890bd0afe274 Mon Sep 17 00:00:00 2001 From: Drew Blessing <drew@gitlab.com> Date: Mon, 20 Sep 2021 15:54:37 -0500 Subject: [PATCH] Update Rouge syntax highlighting gem Changelog: changed --- Gemfile | 2 +- Gemfile.lock | 4 ++-- lib/gitlab/highlight.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 3b637a0253853..fdeb016d8e871 100644 --- a/Gemfile +++ b/Gemfile @@ -165,7 +165,7 @@ gem 'asciidoctor', '~> 2.0.10' gem 'asciidoctor-include-ext', '~> 0.3.1', require: false gem 'asciidoctor-plantuml', '~> 0.0.12' gem 'asciidoctor-kroki', '~> 0.5.0', require: false -gem 'rouge', '~> 3.26.0' +gem 'rouge', '~> 3.26.1' gem 'truncato', '~> 0.7.11' gem 'bootstrap_form', '~> 4.2.0' gem 'nokogiri', '~> 1.11.4' diff --git a/Gemfile.lock b/Gemfile.lock index 99cd6b8bab638..4d2bbf2ed5dd6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1052,7 +1052,7 @@ GEM rexml (3.2.5) rinku (2.0.0) rotp (6.2.0) - rouge (3.26.0) + rouge (3.26.1) rqrcode (0.7.0) chunky_png rqrcode-rails3 (0.1.7) @@ -1595,7 +1595,7 @@ DEPENDENCIES responders (~> 3.0) retriable (~> 3.1.2) rexml (~> 3.2.5) - rouge (~> 3.26.0) + rouge (~> 3.26.1) rqrcode-rails3 (~> 0.1.7) rspec-parameterized rspec-rails (~> 5.0.1) diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb index f830af68e07f8..49712548960e2 100644 --- a/lib/gitlab/highlight.rb +++ b/lib/gitlab/highlight.rb @@ -70,7 +70,7 @@ def highlight_text(text, continue: true, plain: false) end def highlight_plain(text) - @formatter.format(Rouge::Lexers::PlainText.lex(text), context).html_safe + @formatter.format(Rouge::Lexers::PlainText.lex(text), **context).html_safe end def highlight_rich(text, continue: true) @@ -78,7 +78,7 @@ def highlight_rich(text, continue: true) tag = lexer.tag tokens = lexer.lex(text, continue: continue) - Timeout.timeout(timeout_time) { @formatter.format(tokens, context.merge(tag: tag)).html_safe } + Timeout.timeout(timeout_time) { @formatter.format(tokens, **context, tag: tag).html_safe } rescue Timeout::Error => e add_highlight_timeout_metric -- GitLab