Skip to content

Require rouge 5.1 or later - #276

Merged
P-SiZK merged 2 commits into
masterfrom
require-rouge-5
Oct 6, 2026
Merged

P-SiZK merged 2 commits into
masterfrom
require-rouge-5

Conversation

@P-SiZK

@P-SiZK P-SiZK commented Oct 1, 2026

Copy link
Copy Markdown
Member

What

Bump rouge to 5.1 and stop using the html_legacy formatter, which is deprecated in rouge 5.

This replaces #275.

How

  • Change the rouge requirement in the gemspec to ~> 5.1
  • Use HTMLPygments.new(HTML.new) as the formatter in SyntaxHighlight
    • The output is the same as html_legacy

Why

#275 only widens the requirement to >= 4.2, < 6.0, so rouge 5.1 still prints a deprecation warning for HTMLLegacy to stderr.

Refs

P-SiZK and others added 2 commits October 1, 2026 16:04
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@P-SiZK P-SiZK self-assigned this Oct 1, 2026
@P-SiZK
P-SiZK requested review from a team and kimkim0814 and removed request for a team October 1, 2026 07:38

@kimkim0814 kimkim0814 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

DEFAULT_LANGUAGE = "text"
DEFAULT_TIMEOUT = Float::INFINITY
DEFAULT_OPTION = "html_legacy"
FORMATTER = Rouge::Formatters::HTMLPygments.new(Rouge::Formatters::HTML.new)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝
Renamed since it now holds a formatter instance, not an option string.
It also matches the formatter param name in Rouge.highlight.

@P-SiZK
P-SiZK merged commit d49e860 into master Oct 6, 2026
5 checks passed
@P-SiZK
P-SiZK deleted the require-rouge-5 branch October 6, 2026 04:01
@P-SiZK P-SiZK mentioned this pull request Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants