Re-add Wikipedia HTML ToC, View HTML & CSS tweaks #10769
Merged
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.
Wikipedia EPUBs: re-add ToC in content
The ToC is no longer in the HTML we get from the Wikipedia API. So, add it ourselves.
Also, as we can't get anywhere the Wikipedia localized string for "Contents" (ie. "Sommaire" in French), use thick
<HR>
to mark the start and end of this ToC.See #10746 (comment) and followups.
ViewHTML: fix content messed up when consecutive nbsp
Fix bug in replace_in_html() when consecutive matches, that could get parts of the content eaten and now shown.
Also ensure content after leading indentation is not wrapped on the next line.
util.prettifyCSS(): do better with more complex CSS
ie with unprettified:
Before | After:
(But as it is all regex stuff, and not proper CSS tokenization, it may still do bad things in some cases...)
[chore] replace utf8 bytes with Unicode escape sequence
Because it is better if we inprint in our brain while reading code that a right single quotation mark is
U+2019
, rather than its utf8 byte sequence is\xE2\x80\x99
!This change is