diff --git a/Gemfile b/Gemfile
index 3b637a025385329c3bf05aff5c917c0c42e81f51..fdeb016d8e871914601029686ac0a5b76e7f882a 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 99cd6b8bab638fa54bf56a767227ad840e28301a..4d2bbf2ed5dd675ad281825ca5c3486f22834ab5 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 f830af68e07f8635d657176b1af53ba23d33dac0..49712548960e23c3c033c8bb00cb7075df0ae1d5 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