Skip to content

Add JRuby and TruffleRuby to CI matrix#17

Open
gschlager wants to merge 4 commits intomainfrom
add-jruby-truffleruby-ci
Open

Add JRuby and TruffleRuby to CI matrix#17
gschlager wants to merge 4 commits intomainfrom
add-jruby-truffleruby-ci

Conversation

@gschlager
Copy link
Copy Markdown
Member

@gschlager gschlager commented Apr 22, 2026

  • Add JRuby and TruffleRuby to the CI test matrix (with fail-fast: false)
  • Gate commonmarker on MRI via install_if — its Rust/Magnus extension can't build on JRuby or TruffleRuby. Lockfile resolves for all platforms; install is MRI-only, and the one commonmarker-dependent spec is skipped on other engines. universal-java added to lockfile platforms.
  • Switch HTML parser from Nokogiri::HTML5 to Nokogiri::HTML — HTML5 isn't available on JRuby ([feature request] HTML5 parser for JRuby implementation sparklemotion/nokogiri#2227). Practical AST output is identical for the handlers we register.
  • Loosen one malformed-HTML spec to accept either libxml2's nested recovery or JRuby/NekoHTML's sibling recovery — both are valid.

Also set fail-fast: false so one implementation's failure
doesn't cancel the others.
commonmarker 2.x uses a Rust/Magnus native extension that cannot build
on JRuby (no universal-java variant) or TruffleRuby (magnus 0.8.2 is
incompatible with TruffleRuby's rb-sys bindings).

Since commonmarker is only used in one spec (validating MarkdownEscaper
against CommonMark Spec 0.31.2 fixtures), gate it with install_if so
it's resolved into the lockfile but only installed on MRI, and skip
the spec on non-MRI engines. Add universal-java to the lockfile
platforms so JRuby can resolve the bundle.
Nokogiri::HTML5 is not available on JRuby (upstream issue
sparklemotion/nokogiri#2227), which blocked running the test suite
and using the HTML parser on JRuby.

The generic Nokogiri::HTML parser works on all engines. The AST output
is identical in practice: the registered handlers only cover basic
formatting, lists, links, images, code, quotes, and tables. Table
support treats thead/tbody/tfoot as transparent wrappers, so the one
notable HTML5/HTML4 difference (implicit tbody insertion) has no
effect on the resulting AST.
The existing assertion required the recovered tree to be a single
nested <b><i>italic</i></b>. That holds on libxml2 (MRI/TruffleRuby)
but not on JRuby's NekoHTML, which leaves <b> and <i> as siblings.
Both are valid recoveries — nothing crashes, and all text survives.

Assert only that the first child is still a Bold and that both words
appear somewhere in the tree, which is what "gracefully" actually means.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant