Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Fix ignoreWhitespace mode #2

@mallorydxw

Description

@mallorydxw

assertions/src/HTML.php

Lines 16 to 19 in 18a9bef

if ($ignoreWhitespace) {
$out = preg_replace('/>\s+/m', '>', $out);
$out = preg_replace('/\s+</m', '<', $out);
}

This is just wrong. We should be able to iterate through the DOM and when we encounter a text node we should remove all leading/trailing whitespace.

Metadata

Metadata

Assignees

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