Commit graph

58 commits

Author SHA1 Message Date
Brion Vibber
d60063eac2 Revert r103795 -- adds <dws> pseudotag which modifies preprocessor behavior in some way to eat whitespace
Not sure whether this is something we want, but it should probably be talked over first.
2011-11-23 00:30:13 +00:00
Mark A. Hershberger
5bd4f88169 Fixes Bug 31865 - Tag <dws> for discarding whitespaces.
Patch with parser tests from Van de Bugger
2011-11-21 01:45:23 +00:00
Sam Reed
2849f384d4 Bug 31995 - Addition of PPFrame::getTitle
Applied patch by Van de Bugger

Added documentation to go with

Added code to Preprocess_HipHop too
2011-11-09 20:52:24 +00:00
Sam Reed
27665d27ae Update some deprecated code
Documentation

Fix "/*" comments to "/**"

Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Sam Reed
937fc3bcfd Back out r95396 and friends 2011-09-29 22:08:00 +00:00
Aaron Schulz
23d5a27e2e Reverted r86072, r86419 per CR. Lots of conflicts resolved here. Removes lineStart from r87346 code as well for preprocess parser tests. 2011-09-12 19:16:22 +00:00
Roan Kattouw
eb7e4881ea Commit live hack: pass XML_PARSE_HUGE (code uses 1 << 19 because the constant isn't available for some reason) into DOMDocument::loadXML() if the first call to loadXML() failed. This prevents newer versions of libxml2 from throwing a warning and messing up when the XML contains structures that are nested more than 256 levels deep. RELEASE-NOTES added to the 1.18 file, tagging this for backporting to 1.18 too.
We at Wikimedia never noticed this issue until we upgraded libxml2 on one of our servers as part of an OS upgrade, but apparently the interwebs knew about this since at least May 2010. Hat tip
 to http://deriksmith.livejournal.com/57617.html , where I found this fix.
2011-09-09 11:28:00 +00:00
Sam Reed
44020e254c Merge the iwtransclusion branch back into trunk
Hexmode fixed broken unit tests in revisions after last time
2011-08-24 13:03:03 +00:00
Sam Reed
801a05afc2 Revert r93688 per Platonides 2011-08-02 16:18:10 +00:00
Sam Reed
47ddc178a1 Commit Preprocessor_DOM live hacks 2011-08-01 23:39:34 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Brion Vibber
b9995d5583 Provisional revert of r89648: "Another try at fixing bug 93 "tilde signatures inside nowiki tags sometimes get expanded (<includeonly><nowiki>~~~~</nowiki></includeonly>)""
This seems to disable PST for <includeonly>...</includeonly> in addition to the <includeonly><nowiki>...</nowiki></includeonly> that the bug is about.
This was caught by a parser test case, but the test case was changed to match... seems like the wrong change?

Also failed to update Preprocessor_HipHop.hphp to match the other two preprocessor classes.
2011-06-07 17:34:20 +00:00
Paul Copperman
27b5141563 Another try at fixing bug 93 "tilde signatures inside nowiki tags sometimes get expanded (<includeonly><nowiki>~~~~</nowiki></includeonly>)"
* Change the preprocessor to insert strip items for <ignore> nodes during pre-save-transform, just like <comment> nodes are handled already. This effectively disables all pre-save-transform steps inside <includeonly> tags.
* Adapt parser tests to the new behavior.
2011-06-07 15:12:26 +00:00
Brion Vibber
96a947fc7a Revert r88997: fix for bug 93 caused some additional problems.
Follow-up to r89191: disable test case for bug 93 as it currently fails (bug left open).
2011-06-02 00:32:43 +00:00
Aaron Schulz
1b245fa447 Broke long line 2011-05-29 19:05:41 +00:00
Sam Reed
060efc24ef Loads more documentation for this file.. Hopefully CR will show it all ;) 2011-05-28 14:54:13 +00:00
Mark A. Hershberger
966116e752 Fix failing preprocessor tests by checking if ot is set. 2011-05-27 21:43:07 +00:00
Mark A. Hershberger
bb8fbba7b3 fix for Bug #93 “tilde signatures inside nowiki tags sometimes get expanded (<includeonly><nowiki>~~~~</nowiki></includeonly>)”
Patch from Brad Jorsch

Fix for includeonly case.  Hopefully fixing this ancient bug doesn't
‘cause people to cry
2011-05-27 20:55:02 +00:00
Sam Reed
912b95a104 More documentation tweaks/additions 2011-05-26 20:26:51 +00:00
Sam Reed
ebef5e723b More documentation tweaks/additions 2011-05-26 19:52:56 +00:00
Mark A. Hershberger
1cc7a162c0 Updated patch from Bergi re: r86676 with tested code to fix bug #28642 2011-04-22 14:25:17 +00:00
Mark A. Hershberger
bf2ae270b5 Fix bug #28642 - wrong part->commentEnd set to abbutting comments
To be able to search for headline-closing equal sign even when
    there are comments between the last = and the linebreak, there are
    some position values appended to the recent domParts. This works
    well with the first comment, but as soon as a second one comes,
    the commentEnd value is set to $wsEnd instead of $endPos.

Patch from Bergi
2011-04-21 22:20:48 +00:00
Leo Koppelkamm
b4ec34def9 Followup to r86064 (List with double line-breaks inside tables). Also contains patch for Bug 16700 by Mormegil (Additional linebreak though nested templates). Parsertests for both 2011-04-14 19:28:45 +00:00
Tim Starling
7440e684a9 HipHop fixes:
* Fixed preg_replace /e usage in Sanitizer and UserMailer. This was already against policy.
* Removed the __get()-based lazy initialisation of $this->xpath in PPNode_DOM. This caused a notice in HipHop, and is also inefficient due to the need for dynamic properties.
* Fixed the assertion in PPNode_DOM::splitHeading(), flagged by Inez Korczynski. It was obviously completely broken, converting a non-existent property to boolean, and it only appeared to work in Zend by accident.
2011-04-05 04:43:54 +00:00
Tim Starling
a20350dd31 * Rewrote StripState to not use ReplacementArray. The memory usage of FSS was excessive when there were many (>10k) strip items. I used preg_replace_callback(), which is slower than strtr() in the simplest case, but much faster than it when the markers have different lengths, which they usually do.
* It was not necessary to preserve the $stripState->general->setPair() interface since it wasn't used by any extensions.
* Moved StripState to its own file.
* Refactored serialiseHalfParsedText() and unserialiseHalfParsedText() so that the bulk of the functionality is in the relevant modules, instead of using scary direct access to object member variables. Made it support the new StripState. It seemed like a lot of work to go to to support an "emergency optimisation" feature in Cite. Cite updates will be in a subsequent commit.
* Fixed spelling of serialiseHalfParsedText() and unserialiseHalfParsedText(), there is unavoidable interface breakage anyway, due to cache object versioning. 
* Moved transparent tags to their own function, as requested in a fixme comment.
* Added documentation for markerSkipCallback().
* Removed OnlyIncludeReplacer, unused since MW 1.12.
2011-02-23 06:58:15 +00:00
Mark A. Hershberger
b4cee86beb w/s fixups 2011-02-12 04:06:22 +00:00
Platonides
6e7632e617 Allow to disable the preprocessor cache with $wgPreprocessorCacheThreshold = false 2011-01-13 17:35:54 +00:00
Platonides
e22cd590e0 Improve a preprocessor comment 2011-01-13 17:30:27 +00:00
Sam Reed
0c59a5f824 Followup r79709, re-add equals
Removed due to previous CR, that had not had any response to, so presumed right
2011-01-06 15:27:49 +00:00
Sam Reed
5c94145e33 Fixup fixme on r67819 2011-01-06 03:24:35 +00:00
Sam Reed
c15c1c6abb More reversion of r77297, 2 of 2 commits to keep it readable in CR (hopefully) 2010-11-25 22:24:28 +00:00
Antoine Musso
6fe29c9c30 revert r76464
* mixed style changes and variable removing
* logic changes
* useful comments removed
2010-11-25 20:01:34 +00:00
Sam Reed
10ecfeb03b Various unused variables, add some braces
Explicitally define some variables used in hook type calls
2010-11-10 19:49:04 +00:00
Sam Reed
6b3b915353 Big attack on unused variables... 2010-10-14 20:53:04 +00:00
Alexandre Emsenhuber
dc50e1a4bf * Added file description headers
* Added @file where needed
2010-08-22 14:31:05 +00:00
Platonides
303dd1cab2 Revert the change to Preprocessor_DOM.php of r71286.
The parsertest "Link with 3 brackets" passes again.
2010-08-20 18:03:45 +00:00
Sam Reed
721ecb6d2d Remove some more unused variables
Remove srvus() from Parser, unused, and calling testSrvus wrongly
2010-08-19 11:21:14 +00:00
Sam Reed
55d5a6c9a2 Fix fixme placed on r30022 by me (fixing per comment)
Adding a few braces too
2010-08-10 12:55:22 +00:00
Platonides
9c143c5900 Use ParserOptions accessors.
Only one direct usage remains, in ParserCache::getKey, which will be rewritten.
2010-08-05 19:01:47 +00:00
Sam Reed
f17a158fea Replace self with PPFrame to define proper location of some constants 2010-07-29 07:20:02 +00:00
Sam Reed
f4f5d17105 A few more wrong static things
Remove some =& from LanguageKk_cyrl
2010-07-25 21:15:27 +00:00
Conrad Irwin
91f6526cfd (bug 19910) Preprocess headings of the form "===+\s+" in the same way as Parser::doHeadings() 2010-06-21 20:33:07 +00:00
Daniel Kinzler
1258dc3268 added newPartNodeArray for creating a node with a list of parts form a php array; useful for programatically constructing template parameters 2010-06-10 15:02:25 +00:00
Alexandre Emsenhuber
1ec45bef2e Fixed some doxygen warnings 2010-06-09 14:57:59 +00:00
Tim Starling
4b13d6b07f Applied patch by Juliano F. Ravasi for bug 20431: constructor for PPCustomFrame_* failed to initialise the object properly. 2009-09-04 00:43:51 +00:00
Chad Horohoe
42fe290d16 (bug 20274) Strict standards issue in 5.3. 2009-08-16 20:56:48 +00:00
Victor Vasiliev
1671616088 Add getArguments, getNamedArguments and getNumberedArguments methods to PPFrame
interface, so extensions can access them.
2009-07-02 16:21:30 +00:00
Aaron Schulz
abb4c5c516 fix profiling 2009-03-06 00:20:44 +00:00
Andrew Garrett
252ef37028 Apply changes made live on Wikimedia cluster related to preprocessor caching to subversion. Patch worked on by Tim Starling and myself.
Changes from the original patch (r46936):
* Add versioning to the cache, so the cache can be purged.
* Only cache preprocessor output for input of over a certain amount (default of 1000 bytes).
2009-02-09 23:18:37 +00:00