* 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
* Run cite handler first thing in phase 3 so that ref-content
is pulled out of the main token stream. This effectively
prevents unclosed/unbalanced tags within ref-tags from
affecting the main stream.
* No change in parser tests.
* Fixes rt diffs on the following pages:
1. en:Bandaid surgeries (zero rt diffs)
2. en:Gondi bank (zero rt diffs)
3. en:Ashland, oh (1 syntactic diff)
The reverted commit (78989e8) had fixed rt-diffs in 1. above,
hadn't changed diffs in 2. and introduced regressions in 3.
Change-Id: I6ad498d9d3711b71e7f427eea214acd10da8647b
* Setting tsr to (endTsr || [null, text.length]) was causing
serious duplication of rt-src on the following page:
en:Almirante Latorre-class battleship
This is the case for ref-tokens that come from templates
which have their TSR stripped. So, we shouldn't attempt
to set it to [null, text.length] again.
* No change in parserTests.
* No change in errors for en:L'Opéra national de Paris.
Change-Id: If6a79638c349c9a3fab42094aad51e2e476f9632
Also remove the src, as we re-set it based on DSR anyway.
No change in parserTests, but three less diffs in L'Opéra national de Paris.
Change-Id: Ia6784efe7d76c41f24a183465393bda78641a8eb
This exposed a few bugs (primarily missing var declarations), which are fixed.
It would for example have caught the shallow clone bug we just fixed, and
should catch similar bugs early in the future.
TODO / issues this exposed:
Avoid attempted tsr modification in ext.core.TemplateHandler.js:306:29. This
is fixed for now by cloning the tokens, but should really be avoided by
stripping the tsr before caching the tokens (anything in phase 1 will work for
example).
Change-Id: I6a1a07de7ac333f31da9cf0ae9ed20e5507bacba
* There was a fixme for this in ext.Cite.js which was triggering
an error in the serializer and introducing rt-diffs.
* No change in parser tests.
* Eliminates semantic error in en:Birkenhauer Island and other
pages.
Change-Id: I9fe6ea26fdf1859d751b02a288393af610be5474
Fix for bug 10537: Cite anchors should be numbered starting at 1
On the way a small refactoring (getting rid of redundant variable)
Change-Id: Iee94917f3f860516cc310d1cdb1c4f9065d40984
- Fixed several bugs in the DSR computation.
- Deleted comment tokens from template output.
- Eliminated TSR info from template output.
- Rearranged order of DOM post passes.
- Updated template encapsulation to use DSR values.
- There are still a few missing pieces and scenarios that are
not handled properly.
Change-Id: I644914902ec1d27418138b107abe765f81178398