Inline images don't display their captions and don't have a
DOM structure for them. They are hidden away in the data-mw
attribute.
So far, we weren't handling <ref>s embedded in these inline
image captions -- both causing rendering diffs in the references
section and crashing the serializer when these nodes were
encountered.
This patch fixes that and also adds parser tests.
The html2html failure added to the blacklist is because of
about-id mismatches in the embedded html. We need smarter
normalization in parserTests.js to remove these false failures.
There is also a long comment about generalizing how this kind
of scenario is handled. Worth tackling that in a separate patch.
In order to simplify and generalize the adhoc nature of
trace output that is currently in place, I had been pondering
creating a DOMProcessor class with state to do that, and
looks like something like will help with this as well.
For this patch, I am leaving behind the special case handling.
Adding state and generalizing how embedded HTML is processed
should be done separately since that requires more thinking
and experimentation.
enwiki/High_Laver?oldid=659441291 and hiwiki/मुक्केबाज़ी?oldid=2689792
now RT without crashers.
Change-Id: I39854c7b5b3e8d7cce84b1b4e05213185f8cccb0
I think this change causes too many issues on non-LTR wikis
(see the associated tasks) to be acceptable in the current form.
Maybe it should be redone to apply to RTL text only if it's
worth it there (apologies, but I don't quite understand the issue).
This reverts commit e9c1521fca
and commit 59ef3c8678 (which was
the previous attempt to fix it and caused different issues).
Bug: T108493
Bug: T110057
Change-Id: I205400c59a342dcc4cdf89791bc1c761805cd2a8
* 4ea8dbd8 exposed a bug handling of nested <refs> (done via
templates). It caused crashers in rt-testing of a few pages.
Ex: enwiki/António de Oliveira Salazar?oldid=676623209
* Reproducible with the following wikitext:
-------------------------------------
x <ref>y {{sfn|Kay|1970|pp=123}}</ref>
<references />
-------------------------------------
* This patch fixes the problem by making sure data-mw and
data-parsoid of the DOM for the nested ref are saved before
serialization to a string.
* Removed the saveHandler from dom.t.unpackDOMFragments.js and
reused the simpler dom-walk code added as part of this patch.
* Also updated comments in ext.Cite.js
* Hard to introduce nested <ref> in parser tests, so no
new tests for this scenario.
Change-Id: I2298bbe87ccddd87f307d206d77d78fcfb0d8a75
Doesn't show an error for the default references group anymore. Only,
if a custom group was defined, but no corresponding references tag added.
Follow up: I9c7c13269d5ec355ccb280402aa8c0cedd208883
Change-Id: I67f4277b83b6b83ba5fc54cdcc021044b65f61c5
On I16a701f3b962b5e7f63554be2f28888a938548b0 we incorporated
unicode-bidi: embed; instead isolate but it caused regression on
* https://fa.wikipedia.org/?oldid=15565588
* https://fa.wikipedia.org/?oldid=15552160
where references ([۱]) comes before number with Persian digits.
Using unicode-bidi: isolate; is the clean solution for fixing this
however due to Firefox bug https://bugzilla.mozilla.org/1185987
it is not going to fix the regression on Firefox so using
display: inline-block; in hope to get same effect with Chrome
on unicode-bidi: isolate; but also support IE and older browsers.
Change-Id: I1d62c1fb282acc72ab20d71cc8cd21e3e1d71493
If a parser does not include the extCite property, ignore
the call and do not check references.
Depends on Ic77aa79aa6e2bf2a9ec00be4cc775d0123bed91a
Bug: T105598
Change-Id: Ic2257eef94fd73932f1e95a84b3b8b0eb245bafc
Restructure code to return early for errors instead of nesting
conditionals. This leaves the outer tree of the function as
the natural flow of the primary purpose.
Makes code more resilient by ensuring that new code added to the
function will not execute under error conditions by removing the
need to keep everything encapsulated in the various levels of
error conditionals.
Change-Id: I1b4a67d344fd9843ca088d008487914f87b1c640
This happens while editing in VisualEditor and ContentTranslation.
This is done by adding unicode-bidi: embed to .mw-ref.
Bug: T105605
Change-Id: I1d03063cad1fa0f2ae8cc792aaaefc715066f17e