escape_html: stop encoding slash, change apostrophe encoding to ', better docs #662
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
More details in the commit message.
I propose this as an alternative to #568; I wrote it before checking if someone had already done much the same thing (or else I would probably not have bothered—though I also have a vague feeling that I knew about #568 last year but have forgotten about it since), but I think my patch is more thorough.
I also propose that this shouldn’t be considered a breaking change; anything that depended on slash being escaped as
/
was already catastrophically wrong; if you want to compare equality of serialised HTML (a very dubious operation in general, tests are the only place I’d even consider countenancing it), you need to normalise it first to be correct. I suppose this is the main argument against performing this change in a minor or patch release: you may break some tests, whether you consider those tests Incorrect-with-a-capital-I or not. After writing this out I guess I’m more sympathetic to the breaking-change classification, though I’m still fed up with gratuitously mangled URLs! 🙂/cc @89z