Skip to content

fix: Restore   behavior from v0.1.27#67

Merged
brody2consult merged 1 commit into
xmldom:masterfrom
karfau:57/fix-nbsp-regression
Jul 1, 2020
Merged

fix: Restore   behavior from v0.1.27#67
brody2consult merged 1 commit into
xmldom:masterfrom
karfau:57/fix-nbsp-regression

Conversation

@karfau

@karfau karfau commented Jun 28, 2020

Copy link
Copy Markdown
Member

Might be considered a breaking change.

fixes #57

Might be considered a breaking change.

fixes xmldom#57
@brody2consult

Copy link
Copy Markdown
Member

Thanks. This would definitely be breaking for anything that does not expect \u00a0 characters for input with &nbsp characters.

@karfau

karfau commented Jun 29, 2020

Copy link
Copy Markdown
Member Author

I think it's a question of definition.
This was the behavior of 0.1.27 changed in 0.2.0 - 0.3.0(so not a semver issue since major is still 0),
Now it "breaks" it "back" so I guess we could call it 0.4.0.
or if you say it was an unintended regression we could include it in 0.3.1.

Your decision.

@brody2consult brody2consult left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved to be merged after PR #77 - it would be nice for me to validate that the Stryker dashboard is updated with this change.

I do have one non-blocking suggestion.

@@ -13,13 +13,8 @@ wows.describe('html normalizer').addBatch({
assert(dom+'', '<div xmlns="http://www.w3.org/1999/xhtml">&lt;123e>&amp;&lt;a<br/></div>');

var dom = new DOMParser().parseFromString('<div>&nbsp;&copy;&nbsp&copy</div>','text/html');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var dom = new DOMParser().parseFromString('<div>&nbsp;&copy;&nbsp&copy</div>','text/html');
var dom = new DOMParser().parseFromString('<div>&copy;&nbsp;&copy;</div>>','text/html');

(simplify the test string and fix the indentation)

Or do we need to keep the "&nbsp&copy" part to test something? If so, I would kinda favor separate test strings, with separate test assertions, to check the &nbsp; behavior and to test with "&nbsp&copy".

I do think it would be better to break this test script into smaller test cases, and potentially multiple files, at some point.

TODO: The assertion would have to be updated as well. Unfortunately the GitHub suggested changes feature does not work for multiple lines if some lines were deleted in the middle.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that the tests are not ideal, that's why I raised #72 to discuss the options.

I would avoid to mix this into other PRs to not loose track.

assert(dom+'', '<div xmlns="http://www.w3.org/1999/xhtml"> \u00a9&amp;nbsp&amp;copy</div>');
assert(dom+'', '<div xmlns="http://www.w3.org/1999/xhtml">\u00a0\u00a9&amp;nbsp&amp;copy</div>');


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@brody2consult brody2consult merged commit 84eb68c into xmldom:master Jul 1, 2020
@brody2consult

Copy link
Copy Markdown
Member

I went ahead with the merge, and the change does now show up on the Stryker dashboard. Thanks!

This was referenced Mar 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression regarding handling of &nbsp; with "(x)html" mimeType

2 participants