Commit graph

217 commits

Author SHA1 Message Date
Subramanya Sastry
28a214a7a3 Removed unnecessary whitespace in tpl name/arg class tests.
Change-Id: Id0346d16fcecd0d44d85f29a45923c8401f47a9c
2012-09-28 18:51:58 -05:00
Subramanya Sastry
96572ab88f Added tests to spec out behavior of html with self-closing tags.
Change-Id: I370bc0ddd2c838bb64239e3c075fc941e55f30b7
2012-09-26 18:28:28 -05:00
Mark Holmquist
a5fd490887 Adding a few tests for categories
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
2012-09-26 14:25:02 -07:00
Subramanya Sastry
edbafab200 Only whitespace changes -- stripped trailing white space.
Change-Id: I3914705d17e2851e413b75ab4bbb4e85448804fd
2012-09-26 14:15:13 -05:00
Subramanya Sastry
bc3e0c08c2 New tests to check handling of tpl-name and tplarg-name clashes.
Change-Id: I99180af6460b8925a64b751650aaae6163e4ac27
2012-09-26 14:12:42 -05:00
Amir E. Aharoni
0ffe674912 (bug 35167) Allow <span dir="ltr|rtl"> in toc items
Added parser tests accordingly.

Change-Id: Ia77f24f53e77b0b9d6112218c93ea15fdefac5de
2012-09-26 06:50:46 +00:00
Subramanya Sastry
5ff95b07e2 Added several template tests to stress Parsoid template RT-ing.
Change-Id: I294e5566b00bba260046f403b247d4d5d169b14f
2012-09-25 16:28:13 -05:00
Subramanya Sastry
ab2b4eeae8 P-wrapping tests to spec. existing behavior to assist Parsoid.
* 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
2012-09-21 12:22:30 -05:00
Alex Monk
48fac18524 (bug 40213) border=0 is pointless, 0 is the default.
Change-Id: I6212915d098466e1317b0c21e7be12d40d467a7d
2012-09-13 23:01:37 +01:00
Fran McCrory
d6028a1811 (bug 34939) Handle mixed-case URL protocols in wikitext
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
2012-09-04 16:26:46 +02:00
csteipp
21971b28bc (bug 39700) Add htmlspecialchars encoding to label
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
2012-08-31 14:51:25 -07:00
tpt
2b9c22deb3 (bug 23226) Add |class= parameter to image links in order to add class(es) to HTML img tag.
Change-Id: If58802ad2c513c1db7bc3488daf4e078b8694b02
2012-08-21 17:25:42 -07:00
Mark Holmquist
56e7fe062f Add in a comment about some funky behavior
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
2012-08-15 15:44:35 -07:00
Catrope
9846b1c1e9 Merge "(bug 24437) Add nofollow to image link" 2012-08-15 01:37:24 +00:00
Daniel Werner
aaf45a0b75 New hook 'ParserTestGlobals'
Allows to set globals before running parser tests.

Change-Id: Iea057b992b260611bca7f3adade2c8214b0dcea2
2012-08-14 00:18:50 +02:00
Subramanya Sastry
e26b5665b5 Added another parser test for headings.
Change-Id: I6a559f5355b3c2da385306a3e5451803f8a2ec86
2012-08-08 14:44:39 -05:00
csteipp
79b4f79434 (bug 24437) Add nofollow to image link
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
2012-08-07 09:14:28 -07:00
Gabriel Wicke
3d35b46891 Add a test for paragraphs with extra newline spacing
This test simply documents the current PHP parser behavior, so that it remains
compatible while we are tweaking Parsoid.

Change-Id: I807efb93da6c69da124bcab5c7fbd531b4deaa2b
2012-08-03 16:33:13 -07:00
robin
e16c4c9ed8 Make DateFormatter work in any language, by default in the page content language
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
2012-07-21 00:27:04 +02:00
Subramanya Sastry
5008a6bcae Added wikitext parsertests for dashes
Change-Id: I0f595f05057068e6459062fc8e8f9fad23021dec
2012-07-04 11:58:16 +02:00
Demon
7f5d2cf1f4 Merge "Math isn't in core, so no point having a TODO in core to do math tests. Just sayin'..." 2012-06-28 13:45:39 +00:00
Gabriel Wicke
b45f1e1f15 Group definition list tests; add doc link
* 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
2012-06-27 16:25:15 +02:00
Subramanya Sastry
9d0bbd4c95 Added several quote tests.
* 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
2012-06-27 15:10:23 +02:00
Reedy
89006a96c0 Math isn't in core, so no point having a TODO in core to do math tests. Just sayin'...
Change-Id: I6eb1cf731b735a496cc734b8f2d8c2132b93c4ea
2012-06-26 23:23:38 +01:00
Subramanya Sastry
3191638514 Tweaks to definition list tests & additional list tests
* 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
2012-06-26 17:35:20 +02:00
GWicke
ae05b76368 Merge "Added several additional definition list tests." 2012-06-26 09:11:07 +00:00
Subramanya Sastry
e9d6981d12 Added several additional definition list tests.
* 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
2012-06-25 23:08:03 -05:00
Nikerabbit
03f81522c5 Merge "Add passing ''italic'''s case to 'Unclosed and unmatched quotes' test" 2012-06-22 12:58:57 +00:00
GWicke
dee9dbb538 Merge "(bug 21660) "Pipe trick" full width commas (with test!)" 2012-06-17 12:26:45 +00:00
Gabriel Wicke
a4311ab8a9 Add passing ''italic'''s case to 'Unclosed and unmatched quotes' test
There are similar cases already in this test, but none of them contains just a
single case in a paragraph.

Change-Id: Ic46265b7f66d24bc51face92ad9be3d02356c104
2012-06-07 10:14:58 +02:00
Subramanya Sastry
5923105af1 Added nested-list tests for covering additional cases for Parsoid.
Change-Id: Ic0ea44a5d965bfd27b34a790f18ef29f2ac20d6a
2012-06-06 17:16:01 -05:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
Gabriel Wicke
f5790ba627 Improve / add two passing link tests
* Add a transition *** -> #** to an existing test
* Add a test for interrupted lists

Change-Id: I09b81099a7e8a8b08fefb194670f91648c3e077f
2012-06-04 13:36:18 +02:00
Gabriel Wicke
da0dd987ed Add passing test for padleft and padright as substr
This is a popular 'misuse' of the padleft/padright functions, which was not
tested in the main parser tests so far.

Change-Id: Icda02b34101c8c35b13c1e84d9f565867148d8d8
2012-06-04 11:29:59 +02:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Gabriel Wicke
1a7f80b18b Add passing test for definition list with empty definition
Change-Id: I850f2389274aca76bab0b4a340a14af58e349b93
2012-05-25 15:38:28 +02:00
Dan Collins
b41981d392 (bug 21660) "Pipe trick" full width commas (with test!)
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
2012-05-23 15:40:25 -04:00
robin
84b8ca9801 Remove extra unneeded whitespace
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
2012-05-12 23:37:50 +02:00
robin
96753a2327 Very basic parser test for language function
Change-Id: I7fad6caa460a4f62881c33ae9f7bd30e6a5942d1
2012-05-03 22:23:09 +02:00
Brion VIBBER
c9ebb1698c Merge "(bug 34852) new optional 'link' parameter to <gallery>" 2012-04-16 17:33:07 +00:00
Kim Eik
0a52782667 (bug 34852) new optional 'link' parameter to <gallery>
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
2012-04-16 10:09:31 +02:00
Adam Wight
376d54f4c5 document how the parser handles list items coming from a template,
especially the surprising start-of-line behavior.  This test will
be used to implement matching behavior in Parsoid.

Change-Id: Ibfa13dfd2be2d62c285449cb090e2b112fe30f9b
2012-04-12 08:50:29 -07:00
umherirrender
bf2a9989b2 (bug 23006) create #speciale parser function
Also add explicit Title::getPrefixedText() in
CoreParserFunctions::special, so that method does not rely on
Title::toString.

Change-Id: I1d041b11386bff15811e19de47a662e5ed7a2b07
2012-04-06 09:14:47 +02:00
Gabriel Wicke
792792b68a Add passing test documenting MW's acceptance of pipes between tr attributes
Change-Id: I584a8826348a9acc4facfaadf5766832d262a53d
2012-04-05 15:52:05 +02:00
Amir E. Aharoni
fe0b0270fd (bug 31817) add support for HTML5 <bdi> bidi embed element
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
2012-04-04 13:11:55 -07:00
umherirrender
b5511c68c3 (bug 34355) add a variable and parser function for the namespace number
Change-Id: Ie162cfda7ddd38d4278ceee5fd23f5a4e579cb96
2012-04-03 13:25:06 -07:00
Tim Starling
13b514edae Fixed a few "strip tag exposed" bugs.
* 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.
2012-03-20 04:39:09 +00:00
Tim Starling
a654a6e79a Fixed attempt to write to the wiki's upload directory during parser tests instead of /tmp, this is not allowed. I'm not sure what setupGlobals() is meant to do nowadays, that part is untested. It seems to be duplicated in ParserTest::__construct(). 2012-03-20 00:28:30 +00:00
Amir E. Aharoni
4b439bb6ad Bug 35034 - moved autocomment-prefix between the prefix and the arrow. Follow up to r109086. 2012-03-13 23:09:06 +00:00
Daniel Friesen
73482615dd Revert Microdata improvements in r111891, r111898, r111899, r111901, r111903, and r111906 till after the git migration. 2012-02-20 22:32:18 +00:00