MediaWiki master
MediaWiki\Parser Namespace Reference

Namespaces

namespace  Hook
 
namespace  Parsoid
 

Classes

class  BlockLevelPass
 
class  CacheTime
 Parser cache specific expiry check. More...
 
class  ContentHolder
 
class  CoreMagicVariables
 Expansions of core magic variables, used by the parser. More...
 
class  CoreParserFunctions
 Various core parser functions, registered in every Parser. More...
 
class  CoreTagHooks
 Various tag hooks, registered in every Parser. More...
 
class  DateFormatter
 Date formatter. More...
 
class  DateFormatterFactory
 
class  LinkHolderArray
 
class  MagicWord
 This class encapsulates "magic words" such as "#redirect", NOTOC, etc. More...
 
class  MagicWordArray
 Class for handling an array of magic words. More...
 
class  MagicWordFactory
 Store information about magic words, and create/cache MagicWord objects. More...
 
class  MWTidy
 Class to interact with and configure Remex tidy. More...
 
class  Parser
 PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for making links), and provides a one-way transformation of that wiki markup it into (X)HTML output / markup (which in turn the browser understands, and can display). More...
 
class  ParserCache
 Cache for ParserOutput objects corresponding to the latest page revisions. More...
 
class  ParserCacheFactory
 
class  ParserCacheFilter
 
interface  ParserCacheMetadata
 Read-only interface for metadata about a ParserCache entry. More...
 
class  ParserFactory
 
class  ParserObserver
 
class  ParserOptions
 Set options of the Parser. More...
 
class  ParserOutput
 ParserOutput is a rendering of a Content object or a message. More...
 
class  PPCustomFrame_Hash
 Expansion frame with custom arguments. More...
 
class  PPDPart_Hash
 
class  PPDStack_Hash
 Stack class to help Preprocessor::preprocessToObj() More...
 
class  PPDStackElement_Hash
 
interface  PPFrame
 
class  PPFrame_Hash
 An expansion frame, used as a context to expand the result of preprocessToObj() More...
 
interface  PPNode
 There are three types of nodes: More...
 
class  PPNode_Hash_Array
 
class  PPNode_Hash_Attr
 
class  PPNode_Hash_Text
 
class  PPNode_Hash_Tree
 
class  PPTemplateFrame_Hash
 Expansion frame with template arguments. More...
 
class  Preprocessor
 
class  Preprocessor_Hash
 Differences from DOM schema: More...
 
class  RemexRemoveTagHandler
 Helper class for Sanitizer::removeSomeTags(). More...
 
class  RemexStripTagHandler
 Helper class for Sanitizer::stripAllTags(). More...
 
class  RevisionOutputCache
 Cache for ParserOutput objects. More...
 
class  Sanitizer
 HTML sanitizer for MediaWiki. More...
 
class  StripState
 

Enumerations

enum  ParserOutputFlags : string { values }
 
enum  ParserOutputLinkTypes : string { values }
 
enum  ParserOutputStringSets : string { values }
 

Enumeration Type Documentation

◆ ParserOutputFlags

Enumerator
values 

Disable magic gallery on category page (NOGALLERY).

ResourceLoader modules to load.

Category links.

This is used to selectively disable the auto-magic thumbnail gallery on thumbnail pages.

See also
MainConfigSchema::CategoryMagicGallery
ParserOutput::getNoGallery()
ParserOutput::setNoGallery()
Since
1.38 Whether OOUI should be enabled.
See also
ParserOutput::getEnableOOUI()
ParserOutput::setEnableOOUI()
Since
1.38 Force index policy to be 'index'.
See also
ParserOutput::getIndexPolicy()
ParserOutput::setIndexPolicy()
Since
1.38 Force index policy to be 'noindex'.
See also
ParserOutput::getIndexPolicy()
ParserOutput::setIndexPolicy()
Since
1.38 Show a new section link?
See also
ParserOutput::getNewSection()
ParserOutput::setNewSection()
Since
1.38 Hide the new section link?
See also
ParserOutput::getHideNewSection()
ParserOutput::setHideNewSection()
Since
1.38 The prevent-clickjacking flag. If true, we emit X-Frame-Options: DENY. This controls if anti-clickjacking / frame-breaking headers will be sent. This should be done for pages where edit actions are possible.
See also
ParserOutput::getPreventClickjacking()
ParserOutput::setPreventClickjacking()
Since
1.38 Show the table of contents in the skin?

This is a /suggestion/ based on whether the TOC is "large enough" and other factors, and is intended mostly for skins which want to match the behavior of the traditional inline ToC.

Since
1.39 Suppress the table of contents in the skin?

This reflects the use of the __NOTOC__ magic word in the article (possibly modified by __TOC__ or __FORCETOC__), and represents an explicit request from the author to hide the TOC.

Since
1.41 Suppress the section edit links?

This reflects the ParserOptions::getSuppressSectionEditLinks() flag and affects the default value of enableSectionEditLinks in ParserOutput::getText().

Since
1.42 Wrap section contents to allow collapsing them?

This reflects the ParserOptions::getCollapsibleSections() flag.

Since
1.43 Informs the edit saving system that the canonical output for this page may change after revision insertion; for instance if it uses some properties of the page itself (like categories) which will not be updated until the RefreshLinksJob is run after the revision is saved.
1.38 Similar to VARY_REVISION, but used if we didn't guess the ID correctly. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used that exact revision ID, for instance if the page used {{REVISIONID}} to fetch its own revision ID.
1.38 Similar to VARY_REVISION_ID, but used if we didn't guess the timestamp correctly. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used an actual revision timestamp.
1.38 Similar to VARY_REVISION, but used if we didn't guess the content correctly. For example, a self-transclusion will set this flag, since the lookup of the transcluded content (itself) will be stale until the new revision of this page is actually stored in the DB.
1.38 Similar to VARY_REVISION, but used if the output will change once this page exists in the database.
1.38 Similar to VARY_REVISION, but used if we didn't guess the page id correctly. Informs the edit saving system that getting the canonical output after page insertion requires a parse that used that exact page id.
1.38 Similar to VARY_REVISION. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used the actual user ID.
1.38 Used to avoid extremely stale user signature timestamps (T84843). Set if the signature wikitext contains another '~~~~' or similar (T230652).
1.38 Set when the parse is done in "preview mode".

When the parse is done in "previous mode" various shortcuts are taken to work around the fact that the parsed text does not yet have an actual revision ID, revision time, etc.

See also
ParserOptions::getIsPreview()
Since
1.42 Set when the parse was done with parsoid; clear if the parse was done with the legacy parser (or unknown).
See also
ParserOptions::getUseParsoid()
Since
1.45 Set if this page contains content which could be asynchronous, even if the content was "ready" at the time of the parse.

This ensures that when the page expires from the cache and the page is reparsed, RefreshLinksJob will also be re-run since the content could be different from the last parse. (T373256)

Since
1.44 Set if this page contains asynchronous content which was not ready by the time the output was generated.

At present this reduces the cache TTL. (T373256)

Since
1.44 Return the ParserOutputFlags, as an array of string flag values.
Returns
list<string>
See also
ParserOutput::addCategory
ParserOutput::getCategoryMap
ParserOutput::getCategoryNames Interwiki links
ParserOutput::addInterwikiLink Internationalisation links
ParserOutput::addLanguageLink
ParserOutput::getLanguageLinks Links to media
ParserOutput::addImage
ParserOutput::getImages
ParserOutput::getFileSearchOptions Links to special pages
ParserOutput::addLink
ParserOutput::getLinksSpecial Links to templates
ParserOutput::addTemplate
ParserOutput::getTemplates
ParserOutput::getTemplateIds #ifexist references
ParserOutput::addExistenceDependency Return the ParserOutputLinkTypes, as an array of string flag values.
Returns
list<string>
See also
\MediaWiki\Output\OutputPage::addModules
ParserOutput::addModules
ParserOutput::getModules Style-only ResourceLoader modules to load.
\MediaWiki\Output\OutputPage::addModuleStyles
ParserOutput::addModuleStyles
ParserOutput::getModuleStyles Extra values for the Content-Security-Policy default-src directive.
ParserOutput::addExtraCSPDefaultSrc
ParserOutput::getExtraCSPDefaultSrcs Extra values for the Content-Security-Policy script-src directive.
ParserOutput::addExtraCSPScriptSrc
ParserOutput::getExtraCSPScriptSrcs Extra values for the Content-Security-Policy style-src directive.
ParserOutput::addExtraCSPStyleSrc
ParserOutput::getExtraCSPStyleSrcs Return the ParserOutputStringSets, as an array of string flag values.
Returns
list<string>

Definition at line 28 of file ParserOutputFlags.php.

◆ ParserOutputLinkTypes

Enumerator
values 

Disable magic gallery on category page (NOGALLERY).

ResourceLoader modules to load.

Category links.

This is used to selectively disable the auto-magic thumbnail gallery on thumbnail pages.

See also
MainConfigSchema::CategoryMagicGallery
ParserOutput::getNoGallery()
ParserOutput::setNoGallery()
Since
1.38 Whether OOUI should be enabled.
See also
ParserOutput::getEnableOOUI()
ParserOutput::setEnableOOUI()
Since
1.38 Force index policy to be 'index'.
See also
ParserOutput::getIndexPolicy()
ParserOutput::setIndexPolicy()
Since
1.38 Force index policy to be 'noindex'.
See also
ParserOutput::getIndexPolicy()
ParserOutput::setIndexPolicy()
Since
1.38 Show a new section link?
See also
ParserOutput::getNewSection()
ParserOutput::setNewSection()
Since
1.38 Hide the new section link?
See also
ParserOutput::getHideNewSection()
ParserOutput::setHideNewSection()
Since
1.38 The prevent-clickjacking flag. If true, we emit X-Frame-Options: DENY. This controls if anti-clickjacking / frame-breaking headers will be sent. This should be done for pages where edit actions are possible.
See also
ParserOutput::getPreventClickjacking()
ParserOutput::setPreventClickjacking()
Since
1.38 Show the table of contents in the skin?

This is a /suggestion/ based on whether the TOC is "large enough" and other factors, and is intended mostly for skins which want to match the behavior of the traditional inline ToC.

Since
1.39 Suppress the table of contents in the skin?

This reflects the use of the __NOTOC__ magic word in the article (possibly modified by __TOC__ or __FORCETOC__), and represents an explicit request from the author to hide the TOC.

Since
1.41 Suppress the section edit links?

This reflects the ParserOptions::getSuppressSectionEditLinks() flag and affects the default value of enableSectionEditLinks in ParserOutput::getText().

Since
1.42 Wrap section contents to allow collapsing them?

This reflects the ParserOptions::getCollapsibleSections() flag.

Since
1.43 Informs the edit saving system that the canonical output for this page may change after revision insertion; for instance if it uses some properties of the page itself (like categories) which will not be updated until the RefreshLinksJob is run after the revision is saved.
1.38 Similar to VARY_REVISION, but used if we didn't guess the ID correctly. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used that exact revision ID, for instance if the page used {{REVISIONID}} to fetch its own revision ID.
1.38 Similar to VARY_REVISION_ID, but used if we didn't guess the timestamp correctly. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used an actual revision timestamp.
1.38 Similar to VARY_REVISION, but used if we didn't guess the content correctly. For example, a self-transclusion will set this flag, since the lookup of the transcluded content (itself) will be stale until the new revision of this page is actually stored in the DB.
1.38 Similar to VARY_REVISION, but used if the output will change once this page exists in the database.
1.38 Similar to VARY_REVISION, but used if we didn't guess the page id correctly. Informs the edit saving system that getting the canonical output after page insertion requires a parse that used that exact page id.
1.38 Similar to VARY_REVISION. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used the actual user ID.
1.38 Used to avoid extremely stale user signature timestamps (T84843). Set if the signature wikitext contains another '~~~~' or similar (T230652).
1.38 Set when the parse is done in "preview mode".

When the parse is done in "previous mode" various shortcuts are taken to work around the fact that the parsed text does not yet have an actual revision ID, revision time, etc.

See also
ParserOptions::getIsPreview()
Since
1.42 Set when the parse was done with parsoid; clear if the parse was done with the legacy parser (or unknown).
See also
ParserOptions::getUseParsoid()
Since
1.45 Set if this page contains content which could be asynchronous, even if the content was "ready" at the time of the parse.

This ensures that when the page expires from the cache and the page is reparsed, RefreshLinksJob will also be re-run since the content could be different from the last parse. (T373256)

Since
1.44 Set if this page contains asynchronous content which was not ready by the time the output was generated.

At present this reduces the cache TTL. (T373256)

Since
1.44 Return the ParserOutputFlags, as an array of string flag values.
Returns
list<string>
See also
ParserOutput::addCategory
ParserOutput::getCategoryMap
ParserOutput::getCategoryNames Interwiki links
ParserOutput::addInterwikiLink Internationalisation links
ParserOutput::addLanguageLink
ParserOutput::getLanguageLinks Links to media
ParserOutput::addImage
ParserOutput::getImages
ParserOutput::getFileSearchOptions Links to special pages
ParserOutput::addLink
ParserOutput::getLinksSpecial Links to templates
ParserOutput::addTemplate
ParserOutput::getTemplates
ParserOutput::getTemplateIds #ifexist references
ParserOutput::addExistenceDependency Return the ParserOutputLinkTypes, as an array of string flag values.
Returns
list<string>
See also
\MediaWiki\Output\OutputPage::addModules
ParserOutput::addModules
ParserOutput::getModules Style-only ResourceLoader modules to load.
\MediaWiki\Output\OutputPage::addModuleStyles
ParserOutput::addModuleStyles
ParserOutput::getModuleStyles Extra values for the Content-Security-Policy default-src directive.
ParserOutput::addExtraCSPDefaultSrc
ParserOutput::getExtraCSPDefaultSrcs Extra values for the Content-Security-Policy script-src directive.
ParserOutput::addExtraCSPScriptSrc
ParserOutput::getExtraCSPScriptSrcs Extra values for the Content-Security-Policy style-src directive.
ParserOutput::addExtraCSPStyleSrc
ParserOutput::getExtraCSPStyleSrcs Return the ParserOutputStringSets, as an array of string flag values.
Returns
list<string>

Definition at line 24 of file ParserOutputLinkTypes.php.

◆ ParserOutputStringSets

Enumerator
values 

Disable magic gallery on category page (NOGALLERY).

ResourceLoader modules to load.

Category links.

This is used to selectively disable the auto-magic thumbnail gallery on thumbnail pages.

See also
MainConfigSchema::CategoryMagicGallery
ParserOutput::getNoGallery()
ParserOutput::setNoGallery()
Since
1.38 Whether OOUI should be enabled.
See also
ParserOutput::getEnableOOUI()
ParserOutput::setEnableOOUI()
Since
1.38 Force index policy to be 'index'.
See also
ParserOutput::getIndexPolicy()
ParserOutput::setIndexPolicy()
Since
1.38 Force index policy to be 'noindex'.
See also
ParserOutput::getIndexPolicy()
ParserOutput::setIndexPolicy()
Since
1.38 Show a new section link?
See also
ParserOutput::getNewSection()
ParserOutput::setNewSection()
Since
1.38 Hide the new section link?
See also
ParserOutput::getHideNewSection()
ParserOutput::setHideNewSection()
Since
1.38 The prevent-clickjacking flag. If true, we emit X-Frame-Options: DENY. This controls if anti-clickjacking / frame-breaking headers will be sent. This should be done for pages where edit actions are possible.
See also
ParserOutput::getPreventClickjacking()
ParserOutput::setPreventClickjacking()
Since
1.38 Show the table of contents in the skin?

This is a /suggestion/ based on whether the TOC is "large enough" and other factors, and is intended mostly for skins which want to match the behavior of the traditional inline ToC.

Since
1.39 Suppress the table of contents in the skin?

This reflects the use of the __NOTOC__ magic word in the article (possibly modified by __TOC__ or __FORCETOC__), and represents an explicit request from the author to hide the TOC.

Since
1.41 Suppress the section edit links?

This reflects the ParserOptions::getSuppressSectionEditLinks() flag and affects the default value of enableSectionEditLinks in ParserOutput::getText().

Since
1.42 Wrap section contents to allow collapsing them?

This reflects the ParserOptions::getCollapsibleSections() flag.

Since
1.43 Informs the edit saving system that the canonical output for this page may change after revision insertion; for instance if it uses some properties of the page itself (like categories) which will not be updated until the RefreshLinksJob is run after the revision is saved.
1.38 Similar to VARY_REVISION, but used if we didn't guess the ID correctly. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used that exact revision ID, for instance if the page used {{REVISIONID}} to fetch its own revision ID.
1.38 Similar to VARY_REVISION_ID, but used if we didn't guess the timestamp correctly. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used an actual revision timestamp.
1.38 Similar to VARY_REVISION, but used if we didn't guess the content correctly. For example, a self-transclusion will set this flag, since the lookup of the transcluded content (itself) will be stale until the new revision of this page is actually stored in the DB.
1.38 Similar to VARY_REVISION, but used if the output will change once this page exists in the database.
1.38 Similar to VARY_REVISION, but used if we didn't guess the page id correctly. Informs the edit saving system that getting the canonical output after page insertion requires a parse that used that exact page id.
1.38 Similar to VARY_REVISION. Informs the edit saving system that getting the canonical output after revision insertion requires a parse that used the actual user ID.
1.38 Used to avoid extremely stale user signature timestamps (T84843). Set if the signature wikitext contains another '~~~~' or similar (T230652).
1.38 Set when the parse is done in "preview mode".

When the parse is done in "previous mode" various shortcuts are taken to work around the fact that the parsed text does not yet have an actual revision ID, revision time, etc.

See also
ParserOptions::getIsPreview()
Since
1.42 Set when the parse was done with parsoid; clear if the parse was done with the legacy parser (or unknown).
See also
ParserOptions::getUseParsoid()
Since
1.45 Set if this page contains content which could be asynchronous, even if the content was "ready" at the time of the parse.

This ensures that when the page expires from the cache and the page is reparsed, RefreshLinksJob will also be re-run since the content could be different from the last parse. (T373256)

Since
1.44 Set if this page contains asynchronous content which was not ready by the time the output was generated.

At present this reduces the cache TTL. (T373256)

Since
1.44 Return the ParserOutputFlags, as an array of string flag values.
Returns
list<string>
See also
ParserOutput::addCategory
ParserOutput::getCategoryMap
ParserOutput::getCategoryNames Interwiki links
ParserOutput::addInterwikiLink Internationalisation links
ParserOutput::addLanguageLink
ParserOutput::getLanguageLinks Links to media
ParserOutput::addImage
ParserOutput::getImages
ParserOutput::getFileSearchOptions Links to special pages
ParserOutput::addLink
ParserOutput::getLinksSpecial Links to templates
ParserOutput::addTemplate
ParserOutput::getTemplates
ParserOutput::getTemplateIds #ifexist references
ParserOutput::addExistenceDependency Return the ParserOutputLinkTypes, as an array of string flag values.
Returns
list<string>
See also
\MediaWiki\Output\OutputPage::addModules
ParserOutput::addModules
ParserOutput::getModules Style-only ResourceLoader modules to load.
\MediaWiki\Output\OutputPage::addModuleStyles
ParserOutput::addModuleStyles
ParserOutput::getModuleStyles Extra values for the Content-Security-Policy default-src directive.
ParserOutput::addExtraCSPDefaultSrc
ParserOutput::getExtraCSPDefaultSrcs Extra values for the Content-Security-Policy script-src directive.
ParserOutput::addExtraCSPScriptSrc
ParserOutput::getExtraCSPScriptSrcs Extra values for the Content-Security-Policy style-src directive.
ParserOutput::addExtraCSPStyleSrc
ParserOutput::getExtraCSPStyleSrcs Return the ParserOutputStringSets, as an array of string flag values.
Returns
list<string>

Definition at line 24 of file ParserOutputStringSets.php.