Commit graph

229 commits

Author SHA1 Message Date
Tim Starling
c166e49bca Fixes for r62505:
* In MagicWordArray::matchStartAndRemove(), fixed the case where the length of localised synonym is not precisely the length of the magic word ID plus one
* Fixed the case where matchStartAndRemove() removes the entire string, send empty string not false
* Fix brace style
2010-02-22 07:02:12 +00:00
Domas Mituzas
ac961eca63 global already imported few lines above 2010-02-21 17:07:37 +00:00
Tim Starling
f5b882aadc Moving Conrad's recent parser work out to a branch. Reverted r62434, r62416, r62150, r62111, r62085, r62081, r62080, r62077, r62076, r62069, r62049, r62035. 2010-02-19 05:19:32 +00:00
Mark A. Hershberger
b03bcaacd9 fixes #22501 follow up r61101 remove superfluous, buggy code that was over-rideing displaytitle 2010-02-15 20:18:05 +00:00
Conrad Irwin
8b23dcc084 clean r61713 (and r61710) per code review 2010-02-15 09:34:51 +00:00
Mark A. Hershberger
daf51bcdb3 follow up r61101 for special pages like Special:Version and Special:RecentChanges 2010-02-15 08:36:10 +00:00
Conrad Irwin
26d1b34771 Fix for <poem> after r62416 2010-02-13 14:41:04 +00:00
Conrad Irwin
ae1e32d350 Deprecate old undocumented workaround to bug 2257 (setTransparentTagHook) 2010-02-13 02:22:14 +00:00
Conrad Irwin
76d285dc36 More sensible semantics for pipe trick with section links after r62076
[[hello#world|]] -> [[hello#world|world]] (not [[hello#world]])
2010-02-09 01:05:49 +00:00
Conrad Irwin
7a1fc37382 partial revert for r62081. Make {{PIPETRICK}} like {{PAGENAME}}, add {{PIPETRICKE}}. fix r62077 better. 2010-02-08 02:07:15 +00:00
Conrad Irwin
fe91f53371 Fix bug 20339 allow pipe-trick in log reasons
follows on from r62069 moving logic from Parser into Linker 
(copying brion's technique for dealing with subpages)
2010-02-07 14:50:55 +00:00
Conrad Irwin
14ebd07539 Initialize parser properly in getTransclusionText() 2010-02-07 11:59:58 +00:00
Conrad Irwin
8e258183ae Update Pipe Trick semantics per bug 845 and bug 21660
Allows fullwidth variants of "(", ")", and "," everywhere
Adds [[#section|]] -> [[#section|section]] (initial # only)
Adds [[/sub/section|]] -> [[/sub/section|section]]
2010-02-07 02:15:26 +00:00
Conrad Irwin
13cc94a6c0 Allow pipe trick to work after PST.
Fixes bug 4099, bug 8785, partially bug 16714, bug 2700.
2010-02-06 15:00:45 +00:00
Conrad Irwin
ee6dd72b7f style fixes for r62035 2010-02-05 21:52:37 +00:00
Conrad Irwin
f367303c9e bug 5210 - add getTransclusionText() to the Parser to remove the horrible (and
very broken) attempt to reimplement bits of the preprocessor in 
           EditPage.php.
2010-02-05 16:49:21 +00:00
Tim Starling
c7a8875329 * Fix for r57997 and bug 21222: move math, gallery, pre and nowiki to a new module called CoreTagHooks, analogous to CoreParserFunctions.
* Extended the return interface for tag hooks in a way analogous to the one for parser functions, allowing <nowiki> and <html> to specify that they want to be in the nowiki replacement array instead of the general replacement array.
* Removed ParserOptions::setUseTeX() and related. If <math> is going to be registered in firstCallInit(), then it needs to be stable across multiple parser calls and not change based on parser options. Only one extension caller.

In parserTests.inc: 
* Fixed parser test failures due to $wgMathDirectory not being properly set up. The math directory of the host wiki was being used, leading to a parser test failure if it was not writable.
* Fixed message cache hack from r15502. Made parser tests not fail in the case where a tested message is overwritten by the local wiki. All tests now pass on my installation.
2010-02-03 07:10:58 +00:00
Tim Starling
5ff4947c48 Remove <a> tag hook for now, pending resolution of implementation issues as discussed on CR r58717. 2010-02-03 05:07:57 +00:00
Mark A. Hershberger
93562ac595 fixes problem on PHP 5.1 where titles are displayed as "Object":
TimStarling sez: "presumably some clever person has been using __toString()"
Why did it have to be in code *I* wrote?
2010-02-01 02:45:23 +00:00
Aryeh Gregor
a889c89d1b Require $wgHtml5 for $wgExperimentalHtmlIds
This way, if you want to disable HTML5 you don't have to turn off an
extra setting to maintain validity.
2010-02-01 01:43:07 +00:00
Max Semenik
d6e5fcf83d (bug 16039) Text disappearing after a bad image 2010-01-31 18:26:37 +00:00
Conrad Irwin
7dee03cbdf Fix for r61710. Changing subst: to subst:$1 would cause huge problems with localisation
instead add some proper functions to MagicWord.php to deal with the situation.
2010-01-30 12:46:16 +00:00
Conrad Irwin
13eb1fe98e bug 22297 - "syntax for substitution that doesn't break transclusion"
Adds "safesubst:$1" that works similarly to "subst:$1"
(relevant to bug 5453, bug 16714, bug 4484)
2010-01-30 11:58:19 +00:00
Aryeh Gregor
f8879bfd2b Refactor $wgEnforceHtmlIds code
Renamed setting to $wgExperimentalHtmlIds, off by default, and updated
the code to enforce the much laxer HTML5 rules.  Still needs testing in
various browsers.
2010-01-29 21:44:01 +00:00
Tim Starling
8b9bedbad7 Revert r61528, r61527, r61526, r61525, r61519, r61515, r61053, r61052 (Parser::doQuotes() rewrite). Lots of issues to discuss, needs more review than I have time to give it pre-1.16. I'll split it out to a branch. 2010-01-27 02:41:22 +00:00
Platonides
11f8b8390c Step 4: Profit!!
Add and use PregSplitIterator instead of a direct preg_split.
Slower, but with an upper bound on memory usage.
2010-01-26 18:58:07 +00:00
Platonides
68f5258701 Step 3: Balance the quotes directly on $text
Side effect: Some ' are converted to &#39; on output.
2010-01-26 18:56:50 +00:00
Platonides
fec5f913b9 Step 2: Take out countBoldAndItalic() 2010-01-26 18:55:56 +00:00
Platonides
e1143d8cdd Step 1: Apply attachment 2 from bug 18765. 2010-01-26 18:55:10 +00:00
Platonides
e1c37b835b Parser documentation:
"We are not counting sequences of five apostrophes." comment is wrong. 
It was added on r4578, when they stopped being counted, but since r4747 (fixing bug 40) they are counted again.

Clarify what $first variables are.
2010-01-26 16:16:00 +00:00
Platonides
bd82b2a754 Cosmetic changes from r61052 comments:
else if -> elseif
 Space after # 
 Prefer !== to !=
2010-01-26 11:57:01 +00:00
Sam Reed
099f21929b Revert r61251 as r61252 fixes the extension (so thats presumably "Wrong") 2010-01-19 15:32:49 +00:00
Sam Reed
8c9845b014 Pass parser by reference on line 3344 for bug 22154 extension broken
(line 3351 passes by reference
2010-01-19 15:23:59 +00:00
Aryeh Gregor
cbbdaa51e1 Style fixes to Sanitizer and Parser
All parser tests pass, no functional change.
2010-01-18 01:30:29 +00:00
Mark A. Hershberger
2800ca2db7 follow up r60832 and follow up r60763
* Don't set Parser::$mTitle to random garbage.
* Remove ParserOutput::$displayTitle, make setDisplayTitle() and
  getDisplayTitle() wrappers for their *TitleText() equivalents.
* Remove Parser::$mDo*Convert member variables, move test for
  $mDoubleUnderScores[] directives closer to the action.
* Remove bogus "global $wgContLang".
* Use accessor to get at $mConvRuleTitle
* Fix up showtitle option in parserTests.inc
* TODO: refactor FakeConverter class away
2010-01-15 19:14:23 +00:00
Platonides
4cd1269d6e * (bug 18765) Increased consistency of bold-italic markup for unbalanced quotes.
The representation of six quotes is now improved (changes the meaning of some dubious markup).
2010-01-14 16:18:29 +00:00
Mark A. Hershberger
4a3fd45d47 follow up r60832: Remove un-necessary test for stringiness since "" converts it. 2010-01-14 05:02:24 +00:00
Mark A. Hershberger
a33a9ca681 follow-up r60832: make sure $t always ends up a Title. 2010-01-13 02:41:58 +00:00
Mark A. Hershberger
934c2bcd50 follow up r60763
Recover the -{T| }- rule.  Add the ability to test for it to the parserTests and add a test for it.  Add a couple of disabled tests that I think demonstrate bugs in the LanguageTranslator
2010-01-08 08:22:19 +00:00
Tim Starling
debf8b2eb0 * Fixed the issue of all date functions throwing E_STRICT on their first call due to the default timezone not being set. Used the same approach as phpMyAdmin: utilise PHP's server timezone detection code (which unconditionally throws E_STRICT) with warnings disabled, and store the result with date_default_timezone_set() to avoid future notices. Avoids the need for warning suppression to be dotted all over the codebase, like r58559.
* (bug 2658) Don't use the TZ environment variable at all. Setting it throws an error in some restricted setups. But using it in PHP 5.1+ doesn't make sense anyway, since you'll get the E_STRICT notice described above whenever PHP tries to access it, because Derick hates environment variables. Use date_default_timezone_set().
* If $wgLocaltimezone is null, use the server's timezone as the default for signatures. This was always the behaviour documented in DefaultSettings.php but has not been the actual behaviour for some time: instead, UTC was used by default.
2010-01-08 01:48:53 +00:00
Mark A. Hershberger
857fa9458b follow-up r60763 and r58275. Parser tests now pass. 2010-01-07 05:00:19 +00:00
Mark A. Hershberger
c568220e61 Refactor LanguageConversion so that title conversion isn't so flimsy. Pull MagicWord detection into Parser->doDoubleUnderscore() && remove ParserConvert. 2010-01-07 04:13:14 +00:00
Sam Reed
b6e0df246f Attempt at normalistion of comparison styles - empty string on left and right hand side normalised to it being on the rhs
Before this change, there were (? being regex 0 or 1)

"" ===? 1
'' ===? 24
"" !==? 8
'' !==? 32

== "" 14
== '' 344
!= "" 9
!== "" 4
!= '' 151
!== '' 85


Rhs was the much more common, and the preferred style by many developers.. (Was a similar discussion in #mediawiki recently.. After that lolbugreport i think)

Where there is a string (non empty) on the lhs, and variable/method call on the rhs still need normalising
2010-01-06 19:59:42 +00:00
Roan Kattouw
ab121e365f Readd case statement for {{STYLEPATH}} that was accidentally removed in r57283 2009-12-16 12:02:41 +00:00
Alexandre Emsenhuber
c3ec19debc Replaced all @fixme with "@todo Fixme" since doxygen doesn't have a @fixme command 2009-12-15 21:26:58 +00:00
Chad Horohoe
a4e5e935b6 Mass convert NULL -> null. Left strings and comments alone, obviously. 2009-12-11 21:07:27 +00:00
OverlordQ
8c0dbeb928 Followup to r59818, change transcache timestamp field to be consistent with other timestamp fields, requires schema change 2009-12-09 02:26:50 +00:00
OverlordQ
2ba3527d10 Fix Parser transcache to correctly format timestamps 2009-12-08 02:01:26 +00:00
Daniel Kinzler
52f05fd8fa adding support for <a> tags as a parser tag hook, in order to support rdfa output 2009-11-07 16:46:34 +00:00
Chad Horohoe
25a68735f7 Add bunch of missing classes to the Autoloader 2009-10-25 13:37:15 +00:00