Html sanitize - #1384
Closed
LAfricain wants to merge 3 commits into
Closed
Conversation
Discovered while investigating crosswire#921: wrapping the chapter title and intro material (which legitimately contain block-level <div>/<h2> elements) inside an inline <a name=...> tag is invalid HTML. WebKit's HTML5 parser silently fragments/duplicates the <a> element via the adoption agency algorithm to recover, which can leak inline styles (e.g. italics) past their intended scope in some chapters. Does not fully resolve the italics-leak issue on its own (a deeper cause was also found in cross-chapter OSIS section boundaries and in getVerseBefore()'s tag-crossing markup); tracked separately.
(<h2 class=chapterHeader>) inherit the italic styling from the rule
“.introMaterial { font-style: italic; }” that applies to them, even though
they should remain normal—only the narrative introductory text
should be italicized, not its headings.
Add a targeted CSS rule that removes the italics only for
“.introMaterial h2.chapterHeader”, without affecting the rest of the
intro text or other italic rules elsewhere in the document
(notably the existing “h3 { font-style: %s }” rule, controlled by
the “Italic headings” user preference, which remains unchanged—
it never applies to these <h2> anyway, a preexisting
CSS/HTML discrepancy unrelated to this fix).
Contributor
|
I don't know what you did, but I won't merge this one with this kind of failure to patch cleanly. Whatever you did w/master seems to have caused significant grief/error. |
Contributor
Author
|
Actually, that's exactly what I was afraid of. Either you cherry-pick the goods commits, or you wait until tomorrow when I'll start from scratch by importing to a new branch. |
Contributor
|
I'll wait. No rush. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Section headings (
<h2 class="chapterHeader">) inherit the italic styling from the rule“.introMaterial { font-style: italic; }” that applies to them, even though
they should remain normal—only the narrative introductory text
should be italicized, not its headings.
Add a targeted CSS rule that removes the italics only for
.introMaterial h2.chapterHeader, without affecting the rest of theintro text or other italic rules elsewhere in the document (notably the existing “h3 { font-style: %s }” rule, controlled by the “Italic headings” user preference, which remains unchanged—
it never applies to these
<h2>anyway, a preexisting CSS/HTML discrepancy unrelated to this fix).