If the parser is cloned, we need to clone our data object and
reassociate the hooks. Otherwise references may be lost when the clone
has ParserClearState called.
Change-Id: Ic1d75850e8d610ea890e34c38d062a358fd55178
Depends-On: Ieec65c908d71e89b9a66f83b9a626f842aadacbb
* When named-ref-tags are used multiple times in a document, the
Cite.onReferences function was outputting the ref-content once
for each use in the references section. While this is "harmless"
for regular ref-content, when the ref-content has templates
(ex: {[cite .. }}), that template content is duplicated several
times -- this also means that template expansions seen in the
output no longer has unique ids. Occasionally, this trips up
DOM passes (template encapsulation) which make the reasonable
assumption that template ids are unique. It introduced an
infinite loop in the code that detects template range nestings
and overlaps. This is not triggered always, but only in certain
scenarios. en:Euphoria (Enrique Iglesias album) was a page that
sent the parser into an infinite loop.
* Now fixed by outputting ref-content once.
* In addition, added an error-check in the DOM post-pass that might
get stuck in an infinite loop to output an error message.
* No change in parser test results.
* en:Euphoria (Enrique Iglesias album) now parses and rts without
getting stuck in an infinite loop. Possibly other pages as well.
Change-Id: I81a055999eefe3ca36dfb8a9cda3fee538ae6c65
The 'fakejquery' module just defines the bits we use: $.each, $.map,
$.extend, $.isArray, $.isEmptyObject (and the internal functions required
to implement those).
Change-Id: I626b2f3a3d3a8d395d0c9679e01d3399403636dd
* Added a tokens/x-mediawiki/post-expansion sub-pipeline that
is used to process ref-content. This same pipeline type
could also be used to post-process tokenized content from
other extensions.
* Cleaned up transform handler ranks a bit.
* Fixed paragraph-handler to accept initial state and also
fixed it to do a complete reset on encountering EOFTk.
Cite ref-content handling uses the sub-pipeline while
passing the inBlockToken flag to prevent top-level p-wrapping
of ref-content.
* Fixes references output on en:Barack Obama and introduces
lists in individual ref items.
* No change in parser tests -- how do we add tests for testing
extensions like cite/ref?
Change-Id: I928a3a0f5f989ec28bbe73383794fe6f32599fd1
* Updated #tag parser function code to set tag attributes.
This lets {{Reflist|group=n}} to pass the group=n attribute
to the <references> tag. In turn, this fixes incorrect
reference listing in the above template call. This then
fixes crashers in en:Prophet Muhammed, en:The PS3 and such
pages.
- TODO: parser output for Prophet Muhammed is still broken
where content from body ends up in a table that has
display:none css set.
* Minor code cleanup in AttributeTransformManager.process
and added comment about lazy processing.
Change-Id: If528a3a5c6e22d3ff691dfc6b5b2f00201a26384
The PHP preprocessor returns a references tag with an empty group attribute,
which we did not map to the null reference group. This caused the references
listing to vanish when using the PHP preprocessor.
This patch makes sure the attribute is converted to a string, stripped of
leading/trailing whitespace and finally set to null if no string remains.
No changes in parser tests, since Cite is in a separate extension.
Change-Id: Ib3de375225947a78c362370be8d78504fa24def2
$wgResponsiveImages was added and enabled by default in 966cda.
Makes the wiki to use thumb urls in some cases (up to 2x)
where we showed the original before.
Change-Id: I7b399c7d8ef9e47f8cd5c999738ec349e1585777
If the <references> tag is wrapped (e.g. <div><references></div>) and
the first ref on the page contains a newline, Tidy will get confused and
insert extra paragraph breaks in the output.
We can avoid this easily enough by inserting a newline between
MediaWiki:cite_references_prefix and the first reference's <li>.
Note since this changes the output we also have to adjust the parser
tests to expect the new output.
Change-Id: I8222d53eaf2b20f842915fe90af724711a20bfc5
* Replaced empty (mw:Placeholder) span tags with meta-tag.
* Minor code refactoring in DSR computation.
* Removed hardcoding of "mwt" prefix for object ids.
* Added rt-info for html tags that are not lower-case in the
source wikitext.
- Additional 2 wt2wt tests green.
Change-Id: I9bb6a075bc60b6d78186d23000128eef6a04c787
This should hopefully fix some spurious semantic diffs that are purely based
on ref numbering, which changes if the references are not reset.
Change-Id: I37b1f4cfe69538e1c5ccc81fdad3084c01151700