Skip to content

xml:check-format produces false-positives in some mixed-content scenarios #53

@sewe

Description

@sewe

When checking (X)HTML documents for correct indentation, I run into some strange false-positives.

The following minimal (X)HTML document is the result of some systematic exploration on my part. It should explain where I see the false-positives, namely in certain cases of mixed content (as is used when HTML inline elements like <em> are involved):

<html>
  <head>
    <title>Example</title>
  </head>
  <body>
    <p>This validates.</p>
    <p>This does, <em>too.</em></p>
    <p>Paragraphs with multiple lines also validate:
      Like this.</p>
    <p>They even validate when inline elements are involved.
      Like <em>here.</em>
      Nice, isn't it?</p>
    <p>But we hit a bug if the inline elements covers the whole line.
      <em>Like here.</em></p>
    <p>Or if more text follows the inline element:
      <em>Like in the next line.</em>
      See?</p>
    <p>But placing the closing paragraph tag on a different line is (whitespace-wise) different:
      <em>This "workaround" will bite you when using p::after in CSS.</em>
    </p>
  </body>
</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions