- Make sure void element attributes are sanitized
- Drop attributes on end tags
- Fix Cite to use data-parsoid instead of invalid attributes to pass
information from the token stream to the DOM
Change-Id: If236d4c9197b12ff86a607763f25ed7677623bc4
* isForeignContent now flags content that is not originally
present in the top-level page => transclusion and extension
content. During DOM fragment unpacking, top-level children
of the fragment are always re-assigned the fragment wrapper's
about-id.
* For content that is not flagged isForeignContent (figures that
are reused from cache, and all other users of dom-fragment
including scoped parsing), the fragment DOM is walked and all
about-ids are reassigned fresh about ids.
* From an earlier patchset (now unrelated to the bug fixes here)
* Renamed older badly named isEncapsulatedElt helper
to isFirstEncapsulationWrapperNode.
* Left behind helper to recognize when a node is an
encapsulation wrapper (in case it comes handy later on).
* No change in parser tests.
TODO: We need a parser test with extensions in them.
{{echo|<div>foo</div> <math>1+2</math> <div>bar</div>}} would
not RT properly before this patch because the inner <math> node
did not have the about-id as the surrounding <div>s. This patch
fixes this.
This should also fix a lot of the <timeline> regressions seen
in latest RT testing.
Change-Id: I595e9f46d8ce789a05e4b7dd8b58e443e4c02f98
* Smaller data-mw with adaptive quoting.
* Updated parserTests with new output
* Also add a serializeChildren method that works similar to innerHTML.
* Move HTML normalization to DOMUtils to avoid cyclic dependencies
* Disable non-IE WS to space normalization pass, needs to be improved. See bug
55588. This leads to some new passes and some new fails.
Change-Id: I392881bd8a0cfd9f116e70e9a52d1ef14bbd568b
* Got rid of unnecessary/buggy concat of EOFTk in ext.Cite.js
to wikitext string (concat is only required when processing
a token array from stage 2 onwards).
* Moved temporary node.data.parsoid.wrapper flag to a tmp object
which is then stripped in the cleanup pass. Other temporary
flags from other passes could also be moved here.
* Added a helper to test if a typeOf has a parsoid-generated
value.
Change-Id: I2024c575b5293e5155fc8e2915a34b5fb8394671
* Added mechanism to parse a set of tokens in its own parsing
scope all the way to DOM (which in turn restricts token
transformations to just that scope). This is equivalent to
enforcing well-balanced requirements in restricted contexts
(Ex: link content, image captions for starters). This also
provides an option of enforcing balanced templates in certain
contexts.
This patch applies it to link content and image captions.
Deleted the hacky closeUnclosedBlockTags code for dealing
with bad HTML in captions.
* Refactored common/duplicate code out of Cite handler and
Template handler.
* Updated DSR handling for dom-fragments which eliminates the
warnings about cs/s dsr mismatches seen on image reuse.
it:Dalmine used to get a bunch of DSR inconsistency warnings
when dom-fragments were reused (reported in bug 53071) and
are now fixed with this patch.
* There is still one big hole in DOM fragment unpacking that
has to be fixed. This pertains to improper tag nesting that
will be broken up by the tree builder. The DOM fragment unpacker
has to recognize these scenarios and fix up the DOM (either
by fixing up the final DOM or by stripping mis-nested tags
in the DOM fragment being unpacked).
This patch has an incomplete hack for this that addresses
the common-use case of nested a-tags generated by wikitext
of this form: "[http://foo.bar a [[Wikilink] here]".
Bug: 54454
Bug: 49942
Bug: 44476
Bug: 47326
Change-Id: I33ee38bc43743125b705ac821b339586593dbef7
* This eliminates repetitive code from a few places and might be
useful for future patches as well.
Change-Id: I383ed253a2fa20c1b7429689d17cde176751e29a
For a value of the incorrect type, the type in question is a
relevant part of the error message.
Follows-up Ie0271de755a63fcda8a3671cc115af7bc931a02b.
Change-Id: I09d9f1975bdfabffe44a6f69b5296cdcbf03a51e
Test, rather. It does more harm than good, making Cite annoying to
test in isolation (breaking on WMF jenkins setup) and doesn't really
add much value. The clearState() behavior fixed per bug 20748 should
be tested with a regular PHPUnit test, if anything.
Bug: 54126
Change-Id: I6b65ef7280f95a537f25b7f5c9e57434c21357dd