Ensure <li>s are wrapped in a <ol> or <ul> after sanitizing HTML #13544
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.
Fixes mozilla/addons#14989
Context
This matters when displaying the versions page, where each version is in a
<li>
already, and developers can have release notes containing<li>
of their own. This can be seen:(Look at the output carefully, the HTML from the footer is duplicated, the "clone" appearing either in the sidebar or on top of the existing footer)
Testing
You have to manually craft HTML with
<li>
and no parent<ul>
and get it passed to our sanitize functions to test this. That is harder to achieve now that we have markdown, so best to modify the entry in the database, or pick one that was already broken, or test with https://localhost:3000/en-US/firefox/addon/ratopuse-weasp-vulturkal/versions/ with the patch applied and unapplied to see the difference. Or look at the unit tests.