Skip to content

@blazetrails/html-sanitizer ​

HTML sanitizer for Trails, mirroring rails-html-sanitizer

MeasureValue
Rails counterpartrails-html-sanitizer v1.6.2
API methods matched63% (120 of 189)
Rails tests matched0% (0 of 192)
Ruby files ported11
Ruby files unported7
Measured atfe89b44726

Gaps by file ​

Ported files with Rails methods or tests still missing, largest gap first.

Ruby fileTypeScript fileMethods missingTests matched
sanitizer.rbsanitizer.ts60 / 192
concerns.rbconcerns.ts12—
parser.rbparser.ts9—
scrubbers.rbscrubbers.ts2—

Missing methods ​

The Rails methods parity:api finds no TypeScript counterpart for, by Ruby file.

concerns.rb: 12 missing

scrub!, text, inner_text, to_str, to_text, initialize, serialize_root, parse, remove_comments_before_html_element, to_s, serialize, document_klass

parser.rb: 9 missing

consume_qualified_rule, consume_rules, create_selector, create_style_rule, parse_component_value, parse_declaration, parse_rule, parse_rules, parse_stylesheet

sanitizer.rb: 6 missing

remove_xpaths, properly_encode, full_sanitizer, link_sanitizer, safe_list_sanitizer, white_list_sanitizer

scrubbers.rb: 2 missing

remove_blank_text_nodes, scrubber_symbols

Unported Ruby files ​

Deviation receipts ​

JSDoc receipt tags in the package's source, by the receipt each carries.

TagPERMANENTCONVERGEABLEnone
@noRailsEquivalent100
@missingRailsCall010
@missingRailsArgs100
@internal0037

Permanently skipped tests ​

A String has no encoding tag either (4)

Ratified deviations ​

Each rule below is ratified in the repository's CLAUDE.md files. The first paragraph is quoted; the link opens the full section at this build's commit.

A String has no encoding tag either ​

str.encoding, force_encoding and String#b read or change a per-object encoding. A JS string has none, and trails adds none: the carrier that would hold it is the carrier this section rejects. ruby-compat tags a Uint8Array only. A Rails body that branches on a String's encoding ports the UTF-8 arm, and a test asserting str.encoding is permanently unportable for that assertion.

CLAUDE.md →

Source ​

packages/html-sanitizer on GitHub →