Commit graph

195 commits

Author SHA1 Message Date
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
Chad Horohoe
395eb8c5c6 Fix r57997 and r58039 for realz this time 2009-10-22 22:07:05 +00:00
Chad Horohoe
ffe23ad69f Fix retarded mistake in 57997, move break to within the if block or it defeats the entire purpose 2009-10-22 22:01:14 +00:00
Chad Horohoe
bfaf6cc2b4 (bug 21222) Free <math> tag if not using it. Patch by Platonides. 2009-10-22 11:40:38 +00:00
Happy-melon
69810149c2 (bug 21095) allow tracking categories added to the parser to be disabled by setting the system message to "-". 2009-10-11 12:52:08 +00:00
Daniel Kinzler
9d00a90a21 follow-up to r57278: cache all variables untill the next clearState() 2009-10-02 09:46:17 +00:00
Daniel Kinzler
f0b39b40d2 clear variable cache in clearState() as suggested by tim. fix odd values for long running imports; more vars could be cached now. 2009-10-02 09:09:18 +00:00
Andrew Garrett
1a42431b0f Add signature prefetching logic to Parser, supports r56706. 2009-09-30 10:35:34 +00:00
Happy-melon
96e20213d4 Recommit r56688 (tracking categories for __INDEX__ and __NOINDEX__). 2009-09-28 17:55:00 +00:00
Roan Kattouw
62de3d1478 Add a {{STYLEPATH}} magic word; necessary for upcoming EditToolbar fix 2009-09-26 11:51:37 +00:00
Brion Vibber
0d1d984313 Revert broken rewrite of login system; totally broken.
* Login doesn't attach to session properly, so can't stay logged in!
* Password field shown in plaintext!

If it just DOESN'T WORK please keep it on a work branch, don't put it in trunk!

Reverted:
r56682
r56683
r56684
r56686
r56688
r56696
r56699
r56702
r56703
r56704
r56782
r56896
2009-09-26 00:49:32 +00:00
Happy-melon
a25885d336 (bug16979) Add tracking categories for __INDEX__ and __NOINDEX__. 2009-09-20 22:14:09 +00:00
Brion Vibber
63b39c9164 Revert r53832, r53897, r54145 "(bug 17988) Spaces before [[Category:]] links are no longer ignored" and followup
Causes entire page to go blank under some circumstances.
2009-09-17 00:57:10 +00:00
Andrew Garrett
41437106a9 Relax === check for blank signatures to ==, fixes bug 19261 (alternative solution to r54585) 2009-09-09 17:30:52 +00:00
Aryeh Gregor
d87f3188bc Don't embed ?> in string literals
It messes up some syntax highlighters for some unknown reason.
2009-09-07 00:23:04 +00:00
Nephele
91716a9d7a (bug 2257) Add a $frame parameter to recursiveTagParse so tag extensions can expand template parameters 2009-08-30 06:37:10 +00:00
Andrew Garrett
33f5a8983b Revert r52983 for now, could cause unexpected syntax interactions, we want to investigate this before deploying it 2009-08-27 17:16:15 +00:00
Alexandre Emsenhuber
152638e907 * (bug 8143) Localised parser function names are now correctly case insensitive if they contain non-ASCII characters
Patch by Matěj Grabovský - http://bug-attachment.wikimedia.org/attachment.cgi?id=6406
2009-08-26 15:47:03 +00:00
Raimond Spekking
e1e2c80783 * (bug 20318) Distinct CSS classes for ISBN/RFC/PMID special links added 2009-08-20 09:13:29 +00:00
Tim Starling
831b6d2bf7 * Per my CR comments on r44560: merged FileCache into RepoGroup and fixed wfFindFile() global function bloat. Did not port unused functions such as the batch loading functions.
* Fixed the formal parameter bloat in the file finding functions by making wfFindFile(), RepoGroup::findFile() and FileRepo::findFile() take an associative array of options instead of a rapidly growing collection of formal parameters. Maintained backwards compatibility for the $time parameter, which was the only one used in an extension.
* Took the advice of the todo comment on FileRepo::findFiles() and implemented a calling convention for specifying times (and other options)
* Removed the file object cache from Parser, redundant with the RepoGroup file cache
* Deleted clueless and non-functional LocalRepo::findFiles(). Does not respect redirects, deletion bitfields, or anything else nuanced about FileRepo::findFile(). Does not have the same calling convention as FileRepo::findFiles().
2009-08-15 09:59:59 +00:00
Alexandre Emsenhuber
378e29e5df Per Nikerabbit's comment on r53897 (i.e. fix for r53832, second attempt): changed "m" modifier to "D" so that $ really only matches the end of the string 2009-08-01 12:41:45 +00:00
Alexandre Emsenhuber
afe90f6ffc Per Simetrical's comment on r53832: only trim if there're newlines 2009-07-28 20:16:17 +00:00
Alexandre Emsenhuber
d9944c772a * (bug 17988) Spaces before [[Category:]] links are no longer ignored
* some code style fixes
2009-07-27 19:42:24 +00:00
Brion Vibber
43bf053fd0 * (bug 14080) Short notation links to subpages didn't work in edit summaries
Moved Parser::maybeDoSubpage guts to Linker to call from both locations.
Added some parser test cases.
Note that this might not behave exactly like the main parser in cases where the link text would get altered, but the links are functional. Yay!
2009-07-20 02:07:56 +00:00
Alex Z
95ef1b6fd6 (bug 19814) - Interwiki links from file links - [[File:Foo.jpg|link=de:Test]] - are no longer recorded in the pagelinks table
Also update Parser::makeImage() docs for the link option
2009-07-18 22:49:31 +00:00
Roan Kattouw
b18ec94952 * Fix typo in Linker.php
* Only call ParserOutput::setTOCHTML() if a TOC was really generated
2009-07-14 13:35:07 +00:00
Remember the dot
a70213071d Removed repetition of URIs in the title attributes (tooltips) of external links. Web browsers typically display the target URIs of links in the status bar, making repeating the URIs in tooltips redundant. Some browsers, like Opera, can be configured to display the URIs in tooltips instead of the status bar without the web page having to supply title attributes at all.
As part of this process, I refactored some of Linker.php and removed an unused parameter from getExternalLinkAttributes.
2009-07-12 23:32:16 +00:00
Victor Vasiliev
9bc1e60cab Add function-like tag hooks. They are tags, which content is not preprocessed. Those hooks has access to PPFrame and are parsed on preprocessing stage. They might be useful for built-in programming languages. 2009-07-11 13:03:35 +00:00
Andrew Garrett
9de04ff5b4 * Allow leading-> as syntax for quoting. 2009-07-09 15:17:56 +00:00
Remember the dot
05978d7cf3 Title attributes are now always blank on framed and thumbnailed images, and default to blank on inline images instead of defaulting to the image's filename. Additionally, the alt attribute now defaults to the filename on framed and thumbnailed images if no caption or alt attribute is specified.
I was unable to run the parser test suite ("MediaWiki internal error"), so the test suite may need to be updated to reflect these changes.
2009-07-03 05:13:58 +00:00
Roan Kattouw
82022f21bc Core changes for NavigableTOC extension:
* Always generate the section tree, even when we're not generating a TOC
* Add Parser::mergeSectionTrees() to merge two section trees into one
* Add Linker::generateTOC() to generate the HTML for a TOC from a section tree, and add the section anchor to the section tree to facilitate this. This adds the ability to generate TOCs in extensions; haven't converted Parser.php to use it (yet?). As a side effect, this fixes API bug 18720
2009-06-25 11:05:22 +00:00
Roan Kattouw
7c199a872b (bug 19323) Calls to recursiveTagParse() overwrite ParserOptions::$mSections, causing the real section tree to be overwritten in some cases 2009-06-21 12:52:24 +00:00
Roan Kattouw
ae130186e8 Core changes for NavigableTOC extension:
* Add TOC HTML to ParserOutput
* Add class tocsection-$section to <li> elements in the TOC representing sections in the current page (as opposed to transcluded sections)
2009-06-20 21:47:10 +00:00
Roan Kattouw
5097164dce Add 'index', 'fromtitle', and 'byteoffset' fields to ParserOutput::getSections(). This makes these fields available through the API with action=parse&prop=sections . Also, the byte offset will be needed by the new NavigableTOC extension. 2009-06-20 18:25:30 +00:00
Andrew Garrett
046d986b16 Documentation I added while trying to figure out doBlockLevels, might be useful to others 2009-06-18 20:51:48 +00:00