Skip to content

collapseWhitespace remove the space around the <output> tag #1070

Open
@epexa

Description

@epexa

how to reproduce:

  1. create example html file "input.html":
<!-- It's not ok! Removes space before and after number 23 -->
<p>Before output tag text <output>23</output> after output tag text.</p>
<!-- It's ok -->
<p>Before b tag text <b>23</b> after b tag text.</p>
  1. run with collapseWhitespace parameter
    npx html-minifier --collapse-whitespace input.html -o output.html

html result "output.html":

<!-- It's not ok! Removes space before and after number 23 --><p>Before output tag text<output>23</output>after output tag text.</p><!-- It's ok --><p>Before b tag text <b>23</b> after b tag text.</p>

reason: the "output" is not a inline tag, but is often used as a inline (for javascript).

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