There wasn't really a test for sort keys, but we need those for
the Parsoid round-trip testing. So here they are!
Change-Id: If1fd948d1937872b9604b08c85b11595276f2808
* Block tags on a line change paragraph wrapping behavior for
that line and previous lines. Added tests that captures how
the PHP parser currently deals with it so that Parsoid can
emulate this correctly.
Change-Id: I0bcddd2a6d64502d80f4a8155bcd1425bd5db7be
This patch marks the regex matching url protocol as being case
insensitive. We will from now render links like [HTTP://ww].
Tests added.
Change-Id: I706acb7a0ae194b50d2318763beae4e5e83671f3
Adds htmlspecialchars encoding to the link label, passed
into Linker::makeBrokenImageLinkObj.
This fixes a stored XSS (HTML injection) vulnerability.
* Released as part of 1.20wmf10, 1.19.2, 1.18.5
Change-Id: I0e5f9eeb1f3561b1354aecced74f68ae2fa20dfa
At Gabriel's behest, I've added some information about a test that
is inconsistent with the actual behavior of the parser. Please
consider fixing this if you have the time, else, the parser will
get fixed sometime in the future by someone on the parsoid team.
Change-Id: I2c5db4d9eab6f5f9e84aa354a22eeb2b5124bb0a
Add Parser's extLinkAttribs attributes when an image has a link
parameter, when generating the html. Currently, these may include
rel="nofollow" and the target attribute.
This will correctly add rel="nofollow", respecting $wgNoFollowLinks,
$wgNoFollowDomainExceptions, and $wgNoFollowNsExceptions settings.
Updated parser tests for expected results, added new tests for
$wgNoFollowLinks and $wgNoFollowDomainExceptions exceptions.
Change-Id: Ib4677760ec78a3f0c4ba781d893e0484cc8db3ed
This test simply documents the current PHP parser behavior, so that it remains
compatible while we are tweaking Parsoid.
Change-Id: I807efb93da6c69da124bcab5c7fbd531b4deaa2b
Add a lang parameter to DateFormatter so it can work in any language instead of only the site content language.
(The memcached key is now per language code.)
Use by default parser->getTargetLanguage() so it is parsed in the page content language by default.
Also add some documentation and remove unneeded whitespace.
If needed, a parameter to {{#dateformatter}} can now be easily added, to specify the language to format in.
Change-Id: If61854920065f7c3b4170ab89e9aa66b299f9dd8
* Moved the new definition list tests close to the existing ones
* Added a link to the relevant bug and discussion to the documentation about
differences in nested definition list handling between the PHP parser and
Parsoid
Change-Id: I94fe59db33a242c505d5e82631ccdeef6155fb04
* Added tests by different quote sequence signatures -- primarily
to stress parsoid in different situations and figure out/document
where Parsoid needs to conform with PHP parser output and where
it is acceptable to diverge.
* Some of these tests can likely be purged since they don't test
anything beyond what is already tested elsewhere, but I haven't
investigated that yet. But, there is probably no harm in a few
duplicated tests.
Change-Id: Id2c7b3ea4dac5f9e8f9b042b439061bf9faea9f2
* Tweaked definition list tests to make naming consistent.
* Formatted parsoid only test output to making html structure clear.
* Added explanation of why some parsoid only tests for defn. lists.
* Added a couple additional unordered list tests.
Change-Id: I305920c81fdf45db0bdb9dd8c394a220ff7814ce
* Some of these tests have been marked disabled so that the
PHP parser doesn't test against them. These tests are
marked "(Parsoid only)". The HTML output for these tests
has been set to match Parsoid's output which differs from
what the PHP parser outputs.
Change-Id: Ie19eb000bb74c6ec491f96cb7bf1460648ace030
There are similar cases already in this test, but none of them contains just a
single case in a paragraph.
Change-Id: Ic46265b7f66d24bc51face92ad9be3d02356c104
This is a popular 'misuse' of the padleft/padright functions, which was not
tested in the main parser tests so far.
Change-Id: Icda02b34101c8c35b13c1e84d9f565867148d8d8
Pre-save transform now accepts full width commas, and a parser test is added,
which passes. Originally done by Conrad Irwin, branched out by Tim in r62689
along with a bunch of other stuff, and then it sat in bugzilla for a few months.
Change-Id: I3302e43bab423835cdaee6bdcfc0252a206490fc
This whitespaces causes an extra empty paragraph between text and transcluding a special page.
When a heading precedes a transcluded special page, there is no difference and it's fine with or without this whitespace.
See for example http://incubator.wikimedia.org/w/index.php?title=Incubator:Sandbox&oldid=822299
Change-Id: I6b06006d921368619d3969660c244176344e8aff
The patch adds an optional parameter |link= to the <gallery>
tag. This will allow for images to link to other pages and
externals urls instead of being hardlinked to the image file
that is displayed in the gallery.
Here are a couple of examples.
Link as WikiLink:
<gallery>
File:20120106_001.jpg|link=Main_Page
</gallery>
Link as absolute URI:
<gallery>
File:20120106_001.jpg|my caption|alt=my alt
text|link=http://bugzilla.wikimedia.org
</gallery>
this would cause the link on the thumbnails rendered by the gallery tag to link
to a custom page/url instead of the actual media/image.
a link should be an internal wiki link or an absolute uri as shown in the examples.
Change-Id: I21b276ad5c7a8df13b3a716957d23fd53c37d29e
especially the surprising start-of-line behavior. This test will
be used to implement matching behavior in Parsoid.
Change-Id: Ibfa13dfd2be2d62c285449cb090e2b112fe30f9b
Also add explicit Title::getPrefixedText() in
CoreParserFunctions::special, so that method does not rely on
Title::toString.
Change-Id: I1d041b11386bff15811e19de47a662e5ed7a2b07
Adding <bdi> to $htmlpairsStatic to allow using this tag.
Adds parser test case to confirm that <bdi> makes it through with 'lang' attribute.
This updated patchset also adds <bdi> to the attribute whitelist with the basic common attribute; allows 'lang' and such to get through.
Change-Id: Ib7e6553f017837cb1d49d5718e288228c17392c0
* Introduced Parser::killMarkers() based on the concept from StringFunctions. Used it in cases where markerStripCallback() doesn't make sense semantically, namely grammar, padleft, padright and anchorencode. Used markerStripCallback() in other cases.
* Changed headline unstrip order as suggested by P.Copp on bug 18295
* In CPF::lc() and CPF::uc(), removed the is_callable(). This was a temporary testing hack committed by me in r30109, which allowed me to do differential testing against a copy of the parser from before that revision.