Commit graph

53 commits

Author SHA1 Message Date
Alexandre Emsenhuber
d01e497b7f Stylised ParserOptions.php 2011-07-10 06:45:40 +00:00
Robin Pepermans
ca6fcb7e3f Address comment by Platonides on r90320:
* undefined variable $list in CategoryPage.php
* move code in ParserOptions to a new member of Title class, which falls back to $wgContLang
2011-06-18 14:49:01 +00:00
Robin Pepermans
9077baef30 Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Correct directionality when viewing diffs
* Correct arrows for Pager
* CSS/JS pages always 'en' (LTR)
* Messages on Special:Allmessages have lang and dir attributes based on the selected language
2011-06-18 13:12:52 +00:00
Robin Pepermans
0288575c25 Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Use ParserOptions()->getTargetLanguage() for setting the page language/direction
* Set headings on categories in user language/direction
* Only set language/direction when viewing a page (or editing but only preview and textarea)
2011-06-17 21:48:43 +00:00
Platonides
e23aadab89 Revert r88988 2011-06-16 16:54:06 +00:00
Niklas Laxström
0da0377d1f * Fix I18nTags #languagename to use ParserOptions::getUserLang()
* Fix ParserOptions::getUserLang() to return code as documented
2011-06-13 07:47:39 +00:00
Ilmari Karonen
84aa3fd282 bug 29123: record use of the "editsection" option so that users who can't edit (or have section edit links disabled) get a different cache key; also simplify freaky code layout (briefly tested, seem to work) 2011-05-27 18:51:26 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Niklas Laxström
7fe4a8e1bb Fixed a bug in transformation where previous language could leak into later transformations in UI language. Not sure what do with userlang. 2011-05-15 07:16:25 +00:00
Sam Reed
21d35067b9 Kill some more long deprecated unused functions
Add more @deprecated since where appropriate
2011-05-06 21:09:34 +00:00
Daniel Friesen
8a1b7a1d1d Add a getSkin that returns a dummy linker for BC with extensions still abusing it to access the linker. 2011-04-03 23:32:52 +00:00
Daniel Friesen
e844afb09c Followup r85244; Define all methods as static, implement a DummyLinker to forward calls for passing to hooks and finish off anything in the way. 2011-04-03 12:04:04 +00:00
Daniel Friesen
c817a24081 Drop connetion between Skin and Linker and turn Linker into a staticly usable class. 2011-04-03 11:44:11 +00:00
Sam Reed
e1f5c11aee More bits of documentation 2011-02-27 15:23:41 +00:00
Alexandre Emsenhuber
19f1eccc53 Per Platonides; follow-up r78201: add "stubthreshold" to ParserOptions; also provides a proper fix to r81765 2011-02-20 15:03:25 +00:00
Sam Reed
7d98280f3e More function and variable documentation 2011-02-19 01:02:56 +00:00
Platonides
8272ebfe6b Hack to shortcut it to zero until User::getStubThreshold() produces a call to optionUsed() 2011-02-08 17:58:53 +00:00
Robert Leverington
2a30aa1d25 Add new hook ArticlePrepareTextForEdit, called when preparing text to be saved.
Add new parser option "PreSaveTransform" that allows the pre-save transformation to be selectively disabled.
2011-01-16 21:12:26 +00:00
Platonides
8de91ab2e4 Partial revert of r79520, follow up to r79558. Unconditionally use the new format.
For environments post r70783, they will need to rerender pages with __NOEDITSECTION__ or no headings (hopefully those will be simple pages).
There will be no extra parser cache misses for environments pre r70783.
2011-01-04 11:31:06 +00:00
Daniel Friesen
969561ae3c Try to output editsection markers instead of rendered editsection links and defer the rendering to a point where the markup does not need to be stored in the cache.
Doing this allows skins to override doEditSectionLinks without poluting the parser cache or fragmenting the parser cache more.
As a side effect it eliminates the primary cause of user language based parser cache fragmentation.
Because this makes most old parser cache entries invalid $wgUseEditSectionTokens is provided so that large installations like Wikipedia can keep their old parser cache entries.
2011-01-03 20:17:20 +00:00
Platonides
fe14fdefa7 Store the options used by the parsing in ParserOutput, per r70783 CR. 2010-12-26 19:21:45 +00:00
Alexandre Emsenhuber
933f0cd240 Fix for r78570: correct default value 2010-12-18 22:02:35 +00:00
Alexandre Emsenhuber
3da8358022 Moved constant values from initialiseFromUser() to class definition 2010-12-18 17:56:38 +00:00
Mark A. Hershberger
2e18112d60 Whitespace changes (before others) — “svn diff -x-w” shows no changes 2010-12-11 03:52:35 +00:00
Alexandre Emsenhuber
510309e4ab * (bug 19006) {{REVISIONUSER}} no longer acts like {{CURRENTUSER}} in some cases
* Removed other usages of $wgUser in Parser stuff, as stated in doc
* Added mechanism to get an User object in Parser, based either on the object given in Paser::preSaveTransform() or the ParserOptions otherwise
2010-12-10 18:17:20 +00:00
Priyanka Dhanda
3d0db4ad13 Using getDateFormat instead of mDateFormat in ParserOptions::optionsHash. This was causing parser cache misses when using ApiParse 2010-11-01 23:00:53 +00:00
Ryan Kaldari
4b4a065501 fixing per comments at r70517 2010-09-29 17:25:17 +00:00
Sam Reed
9b52cb83b1 Add some $retval = '' before some wfShellExec 2010-09-02 22:15:20 +00:00
Alexandre Emsenhuber
dc50e1a4bf * Added file description headers
* Added @file where needed
2010-08-22 14:31:05 +00:00
Platonides
a72332929c getSkin() should get a Title as parameter. 2010-08-11 17:11:24 +00:00
Platonides
3f7fcd51a5 Add an extra option for extensions adding an extra key directly instead of the hook or $wgRenderHashAppend, so that they can be added only to some instances. 2010-08-10 14:38:14 +00:00
Platonides
34d35fb6f9 Use only the page relevant pieces in the parser cache key. Eg. two users with different math options will now
use the same parsercache entry for articles without <math> tags.
The cache key format is kept as a fallback so the old cached entries can be reused.

Should boost parsercache hits, but it also makes easier to pollute the parsercache by tag hooks that behave 
badly, directly using $wgUser or $wgLang.

Extensions hooking PageRenderingHash now see !edit=0 and the !printable=1 bits.

Fixes bug 24714 - Usage of {{#dateformat: }} in wikis without $wgUseDynamicDates can lead to unexpected results

Builds upon r70498, r70498, r70501, r70517, r70651, r70653, r70765, r70780.
2010-08-09 21:53:21 +00:00
Platonides
5001cf3583 Follow up r70653. Missing line. 2010-08-09 20:39:48 +00:00
Platonides
6d20e79faf Make thumbsize option go through ParserOptions.
Yet another parameter for makeImageLink2...
2010-08-07 22:35:23 +00:00
Platonides
3f4877b1a0 Revert r70533 and the piece of r70501 that it tried to fix. Note and open bug for the issue.
This has been present since introduction of {{#formatdate: }} in r48249 (bug 4582)
2010-08-07 21:21:28 +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
Platonides
e1e71bde41 Make intfunction go accross the ParserOptions.
Things like calling setUserLang( true ) to use the content language are unsupported and shouldn't be done.
2010-08-05 18:43:49 +00:00
Platonides
3b8b3fd067 Move the math option inside ParserOptions instead of having Math.php directly sneaking into $wgUser.
Throw an exception if trying to use the DateFormat ParserOption and the UseDynamicDates option is not set.
2010-08-05 15:24:36 +00:00
Platonides
7bfebad308 Change quickUserCan( 'edit' ) and getIsPrintable() into setEditSection( false )
Follow up r48544. Init ParserOptions::mIsPrintable in initialiseFromUser()
Move the "No edit section it's printable" from Parser to Article.
This leaves getIsPrintable() unused. Left there for extensions (none seems to be using it, could be removed).

The "even if the user has them on" comment wasn't accurate. The user preference only controls them via CSS.
Anyway, it would work as expected now if it got moved into ParserOptions. The setEditSection() no longer set it to true.

Remove the quickUserCan( 'edit' ) which is just a hidden way of calling $wgUser from the Parser to be explicitely 
done in Article to disable the editsection. This results in quickUserCan being called once instead of twice if $wgUseETag == true;.
2010-08-05 14:37:50 +00:00
Alexandre Emsenhuber
1ec45bef2e Fixed some doxygen warnings 2010-06-09 14:57:59 +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
Alexandre Emsenhuber
af9142d050 * $fname -> __METHOD__
* some style fixes
2010-01-23 15:24:44 +00:00
Niklas Laxström
adbb61d582 Fixing some irritating whitespace 2009-07-07 16:13:58 +00:00
Arash Boostani
c32a1ef480 Fixed bug #11213 - [edit] section links in printable version interfere with cut-and-paste of article text 2009-03-18 23:27:48 +00:00
Alex Z
b6247d470d add mIsPreview and mIsSectionPreview to parserOptions, set in EditPage. patch by Brad Jorsch on bug 16854 (changes to Cite in next commit) 2009-01-26 18:02:13 +00:00
Tim Starling
110c0bb72f Revert revert r41406 of r41333, and removed one space between attributes. 2008-09-30 01:00:40 +00:00
Brion Vibber
0dd22a5406 Back out r41333 -- causes lots of parser test regressions due to funny spacing. Probably an easy fix but it wasn't tested apparently. :) 2008-09-30 00:14:25 +00:00
Tim Starling
cdfdb50943 * Added the ability to set the target attribute on external links with $wgExternalLinkTarget
* Removed the namespace parameter from Linker::makeExternalLink(), added a generic associative array of attributes instead. Let the Parser decide whether to use rel=nofollow.
2008-09-28 02:35:37 +00:00
Ryan Schmidt
b3b81715d5 * $wgAllowExternalImagesFrom may now be an array of multiple strings.
* Added an on-wiki external image whitelist. Items in this whitelist are
  treated as regular expression fragments to match for when possibly
  displaying an external image inline. Controlled by $wgEnableImageWhitelist
  (true by default)
2008-09-01 18:49:14 +00:00
Tim Starling
64378ddf3b $wgCleanSignatures to disable Parser::cleanSig(). Requested by Wikia. 2008-07-31 09:41:28 +00:00