Skip to content

Whitespace around <ruby> is removed #904

@YodasWs

Description

@YodasWs

<ruby> is an inline tag, yet the minifier is removing all whitespace that surrounds it.

Example

Input

<p>I love to eat <ruby lang="fr">pain au chocolat<rt lang="en-US">chocolate croissants</rt></ruby> and éclairs.</p>

Expected

I would not expect the above line to have any changes.

Actual

I am actually getting this output:

<p>I love to eat<ruby lang="fr">pain au chocolat<rt lang="en-US">chocolate croissants</rt></ruby> and éclairs.</p>

Which would get displayed like this in a browser:

I love to eatpain au chocolatand éclairs.

<rp>

⚠️ You will also need to test and potentially correct whitespace in/around <rp>. E.g.:

<p>I love to eat <ruby lang="fr">pain au chocolat<rp> (</rp><rt lang="en-US">chocolate croissants</rt><rp>)</rp></ruby> and éclairs.</p>

ℹ️ Notice the space before the opening parenthesis in the first <rp>.

also

This was found in html-minifier version 3.5.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions