Parsoid
A bidirectional parser between wikitext and HTML5
|
Site-level configuration interface for Parsoid. More...
Public Member Functions | |
registerExtensionModule ( $configOrSpec) | |
Register a Parsoid extension module. | |
unregisterExtensionModule (int $extId) | |
Unregister a Parsoid extension module. | |
getExtensionModules () | |
Return the set of Parsoid extension modules associated with this SiteConfig. | |
__construct () | |
Base constructor. | |
fakeTimestamp () | |
Fake timestamp, for unit tests. | |
getObjectFactory () | |
Return an object factory to use when instantiating extensions. | |
tagNeedsNowikiStrippedInTagPF (string $lowerTagName) | |
getContentModelHandler (string $contentmodel) | |
Return a ContentModelHandler for the specified $contentmodel, if one is registered. | |
isExtensionTag (string $name) | |
Determine whether a given name, which must have already been converted to lower case, is a valid extension tag name. | |
isAnnotationTag (string $tagName) | |
getAnnotationTags () | |
Get an array of defined annotation tags in lower case. | |
getExtensionTagNameMap () | |
Get an array of defined extension tags, with the lower case name in the key, and the value being arbitrary. | |
getExtTagConfig (string $tagName) | |
getExtTagImpl (string $tagName) | |
getExtDOMProcessors () | |
Return an array mapping extension name to an array of object factory specs for Ext\DOMProcessor objects. | |
getWt2HtmlLimits () | |
getHtml2WtLimits () | |
getNoFollowConfig () | |
getExternalLinkTarget () | |
Global config | |
getLogger () | |
General log channel. | |
setLogger (?LoggerInterface $logger) | |
Set the log channel, for debugging. | |
nativeGalleryEnabled () | |
"Native gallery" serialization. | |
galleryOptions () | |
Default gallery options for this wiki. | |
addHTMLTemplateParameters () | |
When processing template parameters, parse them to HTML and add it to the template parameters data. | |
linting () | |
Whether to enable linter Backend. | |
tidyWhitespaceBugMaxLength () | |
Maximum run length for Tidy whitespace bug. | |
metrics () | |
Statistics aggregator, for counting and timing. | |
scrubBidiChars () | |
If enabled, bidi chars adjacent to category links will be stripped in the html -> wt serialization pass. | |
Static Public Member Functions | |
static | createLogger (?string $filePath=null) |
Protected Member Functions | |
getNonNativeExtensionTags () | |
Get an array of defined extension tags, with the lower case name in the key, the value arbitrary. | |
processExtensionModule (ExtensionModule $ext) | |
Register a Parsoid-compatible extension. | |
getExtConfig () | |
Protected Attributes | |
$magicWordMap | |
$functionSynonyms | |
$interwikiMapNoNamespaces | |
$linkTrailRegex = false | |
$logger = null | |
$iwMatcherBatchSize = 4096 | |
$addHTMLTemplateParameters = false | |
$scrubBidiChars = false | |
$linterEnabled = false | |
$extConfig = null | |
$wt2htmlLimits | |
@phan-var array<string,int> | |
$html2wtLimits | |
@phan-var array<string,int> | |
Wiki config | |
allowedExternalImagePrefixes () | |
Allowed external image URL prefixes. | |
baseURI () | |
Site base URI. | |
relativeLinkPrefix () | |
Prefix for relative links. | |
bswPagePropRegexp () | |
Regex matching all double-underscore magic words. | |
canonicalNamespaceId (string $name) | |
Map a canonical namespace name to its index. | |
namespaceId (string $name) | |
Map a namespace name to its index. | |
namespaceName (int $ns) | |
Map a namespace index to its preferred name. | |
namespaceHasSubpages (int $ns) | |
Test if a namespace has subpages. | |
namespaceCase (int $ns) | |
Return namespace case setting. | |
namespaceIsTalk (int $ns) | |
Test if a namespace is a talk namespace. | |
ucfirst (string $str) | |
Uppercasing method for titles. | |
specialPageLocalName (string $alias) | |
Get the default local name for a special page. | |
interwikiMagic () | |
Treat language links as magic connectors, not inline links. | |
interwikiMap () | |
Interwiki link data. | |
interwikiMapNoNamespaces () | |
Interwiki link data, after removing items that conflict with namespace names. | |
interwikiMatcher (string $href) | |
Match interwiki URLs. | |
iwp () | |
Wiki identifier, for cache keys. | |
legalTitleChars () | |
Legal title characters. | |
linkPrefixRegex () | |
Link prefix regular expression. | |
linkTrailRegex () | |
Link trail regular expression. | |
lang () | |
Wiki language code. | |
mainpage () | |
Main page title. | |
responsiveReferences () | |
Responsive references configuration. | |
rtl () | |
Whether the wiki language is right-to-left. | |
langConverterEnabled (string $lang) | |
Whether language converter is enabled for the specified language. | |
langConverterEnabledForLanguage (string $lang) | |
Is the language converter enabled for this language? | |
script () | |
The URL path to index.php. | |
scriptpath () | |
FIXME: This is only used to compute the modules path below and maybe shouldn't be exposed. | |
server () | |
The base URL of the server. | |
exportMetadataToHead (Document $document, ContentMetadataCollector $metadata, string $defaultTitle, string $lang) | |
Export content metadata via meta tags (and via a stylesheet for now to aid some clients). | |
redirectRegexp () | |
A regexp matching the localized 'REDIRECT' marker for this wiki. | |
categoryRegexp () | |
A regexp matching the localized 'Category' prefix for this wiki. | |
bswRegexp () | |
A regexp matching localized behavior switches for this wiki. | |
solTransparentWikitextRegexp () | |
A regex matching a line containing just whitespace, comments, and sol transparent links and behavior switches. | |
solTransparentWikitextNoWsRegexp (bool $addIncludes=false) | |
A regex matching a line containing just comments and sol transparent links and behavior switches. | |
timezoneOffset () | |
The wiki's time zone offset. | |
variants () | |
Language variant information. | |
widthOption () | |
Default thumbnail width. | |
magicWords () | |
List all magic words by alias. | |
mwAliases () | |
List all magic words by canonical name. | |
getMagicWordForFunctionHook (string $str) | |
Return canonical magic word for a function hook. | |
getMagicWordForVariable (string $str) | |
Return canonical magic word for a variable. | |
magicWordCanonicalName (string $word) | |
Get canonical magicword name for the input word. | |
isMagicWord (string $word) | |
Check if a string is a recognized magic word. | |
getMagicWordWT (string $word, string $suggest) | |
Convert the internal canonical magic word name to the wikitext alias. | |
getMagicWordMatcher (string $id) | |
Get a regexp matching a localized magic word, given its id. | |
getMediaPrefixParameterizedAliasMatcher () | |
Get a matcher function for fetching values out of interpolated magic words which are media prefix options. | |
getMaxTemplateDepth () | |
Get the maximum template depth. | |
getExtResourceURLPatternMatcher () | |
Matcher for ISBN/RFC/PMID URL patterns, returning the type and number. | |
makeExtResourceURL (array $match, string $href, string $content) | |
Serialize ISBN/RFC/PMID URL patterns. | |
getProtocolsRegex ( $excludeProtRel=false) | |
Get a regex fragment matching URL protocols, quoted for an exclamation mark delimiter. | |
hasValidProtocol (string $potentialLink) | |
Matcher for valid protocols, must be anchored at start of string. | |
findValidProtocol (string $potentialLink) | |
Matcher for valid protocols, may occur at any point within string. | |
linkTrail () | |
Return raw link trail regexp from config. | |
exportMetadataHelper (Document $document, string $modulesLoadURI, array $modules, array $moduleStyles, array $jsConfigVars, string $htmlTitle, string $lang) | |
Helper function to create <head> elements from metadata. | |
getVariableIDs () | |
getMagicWords () | |
haveComputedFunctionSynonyms () | |
Does the SiteConfig provide precomputed function synonyms? If no, the SiteConfig is expected to provide an implementation for updateFunctionSynonym. | |
getFunctionSynonyms () | |
Get a list of precomputed function synonyms. | |
updateFunctionSynonym (string $func, string $magicword, bool $caseSensitive) | |
getParameterizedAliasMatcher (array $words) | |
Get a matcher function for fetching values out of interpolated magic words, ie those with $1 in their aliases. | |
getSpecialNSAliases () | |
Return name spaces aliases for the NS_SPECIAL namespace. | |
getSpecialPageAliases (string $specialPage) | |
Return Special Page aliases for a special page name. | |
getProtocols () | |
Get the list of valid protocols. | |
static | quoteTitleRe (string $s, string $delimiter='/') |
Quote a title regex. | |
Site-level configuration interface for Parsoid.
This includes both global configuration and wiki-level configuration.
Wikimedia\Parsoid\Config\SiteConfig::__construct | ( | ) |
Base constructor.
This constructor is public because it is used to create mock objects in our test suite.
Wikimedia\Parsoid\Config\SiteConfig::addHTMLTemplateParameters | ( | ) |
When processing template parameters, parse them to HTML and add it to the template parameters data.
|
abstract |
Allowed external image URL prefixes.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
|
abstract |
Site base URI.
This would be the URI found in <base href="..." />
.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::bswPagePropRegexp | ( | ) |
Regex matching all double-underscore magic words.
|
abstract |
A regexp matching localized behavior switches for this wiki.
The regexp should be delimited, but should not have boundary anchors or capture groups.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Map a canonical namespace name to its index.
string | $name | all-lowercase and with underscores rather than spaces. |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
A regexp matching the localized 'Category' prefix for this wiki.
The regexp should be delimited, but should not have boundary anchors or capture groups.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
static |
?string | $filePath | File to log to (if null, logs to console) |
|
protected |
Helper function to create <head> elements from metadata.
Document | $document | |
string | $modulesLoadURI | |
string[] | $modules | |
string[] | $moduleStyles | |
array<string,mixed> | $jsConfigVars | |
string | $htmlTitle | The display title, as escaped HTML |
string | $lang |
|
abstract |
Export content metadata via meta tags (and via a stylesheet for now to aid some clients).
Document | $document | |
ContentMetadataCollector | $metadata | |
string | $defaultTitle | The default title to display, as an unescaped string |
string | $lang |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::fakeTimestamp | ( | ) |
Fake timestamp, for unit tests.
Reimplemented in Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::findValidProtocol | ( | string | $potentialLink | ) |
Matcher for valid protocols, may occur at any point within string.
string | $potentialLink |
Wikimedia\Parsoid\Config\SiteConfig::galleryOptions | ( | ) |
Default gallery options for this wiki.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getAnnotationTags | ( | ) |
Get an array of defined annotation tags in lower case.
Wikimedia\Parsoid\Config\SiteConfig::getContentModelHandler | ( | string | $contentmodel | ) |
Return a ContentModelHandler for the specified $contentmodel, if one is registered.
If null is returned, will use the default wikitext content model handler.
string | $contentmodel |
|
protected |
Wikimedia\Parsoid\Config\SiteConfig::getExtDOMProcessors | ( | ) |
Return an array mapping extension name to an array of object factory specs for Ext\DOMProcessor objects.
|
final |
Return the set of Parsoid extension modules associated with this SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getExtensionTagNameMap | ( | ) |
Get an array of defined extension tags, with the lower case name in the key, and the value being arbitrary.
|
abstract |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getExtResourceURLPatternMatcher | ( | ) |
Matcher for ISBN/RFC/PMID URL patterns, returning the type and number.
The match method takes a string and returns false on no match or a tuple like this on match: [ 'RFC', '12345' ]
Wikimedia\Parsoid\Config\SiteConfig::getExtTagConfig | ( | string | $tagName | ) |
string | $tagName | Extension tag name |
Wikimedia\Parsoid\Config\SiteConfig::getExtTagImpl | ( | string | $tagName | ) |
string | $tagName | Extension tag name |
|
protected |
Get a list of precomputed function synonyms.
Wikimedia\Parsoid\Config\SiteConfig::getHtml2WtLimits | ( | ) |
Wikimedia\Parsoid\Config\SiteConfig::getLogger | ( | ) |
General log channel.
Wikimedia\Parsoid\Config\SiteConfig::getMagicWordForFunctionHook | ( | string | $str | ) |
Return canonical magic word for a function hook.
string | $str |
Wikimedia\Parsoid\Config\SiteConfig::getMagicWordForVariable | ( | string | $str | ) |
Return canonical magic word for a variable.
string | $str |
|
abstract |
Get a regexp matching a localized magic word, given its id.
FIXME: misleading function name
string | $id |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstractprotected |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getMagicWordWT | ( | string | $word, |
string | $suggest ) |
Convert the internal canonical magic word name to the wikitext alias.
string | $word | Canonical magic word name |
string | $suggest | Suggested alias (used as fallback and preferred choice) |
|
abstract |
Get the maximum template depth.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
final |
Get a matcher function for fetching values out of interpolated magic words which are media prefix options.
The matcher takes a string and returns null if it doesn't match any of the words, or an associative array if it did match:
|
abstract |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstractprotected |
Get an array of defined extension tags, with the lower case name in the key, the value arbitrary.
This is the set of extension tags that are configured in M/W core. $coreExtModules may already be part of it, but eventually this distinction will disappear since all extension tags have to be defined against the Parsoid's extension API.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getObjectFactory | ( | ) |
Return an object factory to use when instantiating extensions.
(This is assumed to be plumbed up to an appropriate service container.)
string | $id |
string | $id |
|
abstractprotected |
Get a matcher function for fetching values out of interpolated magic words, ie those with $1
in their aliases.
The matcher takes a string and returns null if it doesn't match any of the words, or an associative array if it did match:
string[] | $words | Magic words to match |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstractprotected |
Get the list of valid protocols.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getProtocolsRegex | ( | $excludeProtRel = false | ) |
Get a regex fragment matching URL protocols, quoted for an exclamation mark delimiter.
The case-insensitive option should be used.
bool | $excludeProtRel | Whether to exclude protocol-relative URLs |
|
abstractprotected |
Return name spaces aliases for the NS_SPECIAL namespace.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstractprotected |
Return Special Page aliases for a special page name.
string | $specialPage |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstractprotected |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::getWt2HtmlLimits | ( | ) |
Wikimedia\Parsoid\Config\SiteConfig::hasValidProtocol | ( | string | $potentialLink | ) |
Matcher for valid protocols, must be anchored at start of string.
string | $potentialLink |
|
protected |
Does the SiteConfig provide precomputed function synonyms? If no, the SiteConfig is expected to provide an implementation for updateFunctionSynonym.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Treat language links as magic connectors, not inline links.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
|
abstract |
Interwiki link data.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::interwikiMapNoNamespaces | ( | ) |
Interwiki link data, after removing items that conflict with namespace names.
(In case of such conflict, namespace wins, interwiki is ignored.)
Wikimedia\Parsoid\Config\SiteConfig::interwikiMatcher | ( | string | $href | ) |
Match interwiki URLs.
string | $href | Link to match against |
Wikimedia\Parsoid\Config\SiteConfig::isAnnotationTag | ( | string | $tagName | ) |
string | $tagName | is $tagName an annotation tag? |
Wikimedia\Parsoid\Config\SiteConfig::isExtensionTag | ( | string | $name | ) |
Determine whether a given name, which must have already been converted to lower case, is a valid extension tag name.
string | $name |
Wikimedia\Parsoid\Config\SiteConfig::isMagicWord | ( | string | $word | ) |
Check if a string is a recognized magic word.
string | $word |
|
abstract |
Wiki identifier, for cache keys.
Should match a key in mwApiMap()?
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Wiki language code.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Whether language converter is enabled for the specified language.
string | $lang | Language code |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::langConverterEnabledForLanguage | ( | string | $lang | ) |
Is the language converter enabled for this language?
string | $lang |
|
abstract |
Legal title characters.
Regex is intended to match bytes, not Unicode characters.
[]
) Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Link prefix regular expression.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstractprotected |
Return raw link trail regexp from config.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::linkTrailRegex | ( | ) |
Link trail regular expression.
Reimplemented in Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::linting | ( | ) |
Whether to enable linter Backend.
Wikimedia\Parsoid\Config\SiteConfig::magicWordCanonicalName | ( | string | $word | ) |
Get canonical magicword name for the input word.
string | $word |
Wikimedia\Parsoid\Config\SiteConfig::magicWords | ( | ) |
List all magic words by alias.
|
abstract |
Main page title.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::makeExtResourceURL | ( | array | $match, |
string | $href, | ||
string | $content ) |
Serialize ISBN/RFC/PMID URL patterns.
string[] | $match | As returned by the getExtResourceURLPatternMatcher() matcher |
string | $href | Fallback link target, if $match is invalid. |
string | $content | Link text |
Wikimedia\Parsoid\Config\SiteConfig::metrics | ( | ) |
Statistics aggregator, for counting and timing.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::mwAliases | ( | ) |
List all magic words by canonical name.
|
abstract |
Return namespace case setting.
int | $ns |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Test if a namespace has subpages.
int | $ns |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Map a namespace name to its index.
string | $name |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::namespaceIsTalk | ( | int | $ns | ) |
Test if a namespace is a talk namespace.
int | $ns |
|
abstract |
Map a namespace index to its preferred name.
int | $ns |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::nativeGalleryEnabled | ( | ) |
"Native gallery" serialization.
When true
we always serialize using the HTML generated by our native gallery extension. When false
we emit the original wikitext in an extsrc
attribute, and only serialize from HTML when extsrc
is dropped (ie, when the gallery is edited), since T214648/T214649 cause a lot of normalization.
This is enabled in true
development but still false
in production.
|
protected |
Register a Parsoid-compatible extension.
ExtensionModule | $ext |
|
staticprotected |
Quote a title regex.
Assumes '/' as the delimiter, and replaces spaces or underscores with [ _]
so either will be matched.
string | $s | |
string | $delimiter | Defaults to '/' |
|
abstract |
A regexp matching the localized 'REDIRECT' marker for this wiki.
The regexp should be delimited, but should not have boundary anchors or capture groups.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
final |
Register a Parsoid extension module.
string|array{name:string}|array{factory:callable}|array{class:class-string<ExtensionModule>} | $configOrSpec Either an object factory specification for an ExtensionModule object, or else the configuration array which ExtensionModule::getConfig() would return. (The latter is preferred, but our internal extensions use the former.) |
array | $config |
Wikimedia\Parsoid\Config\SiteConfig::relativeLinkPrefix | ( | ) |
Prefix for relative links.
Prefix to prepend to a page title to link to that page. Intended to be relative to the URI returned by baseURI().
If possible, keep the default "./" so clients need not know this value to extract titles from link hrefs.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig.
|
abstract |
Responsive references configuration.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
|
abstract |
Whether the wiki language is right-to-left.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
The URL path to index.php.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
|
abstract |
FIXME: This is only used to compute the modules path below and maybe shouldn't be exposed.
The base wiki path
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::scrubBidiChars | ( | ) |
If enabled, bidi chars adjacent to category links will be stripped in the html -> wt serialization pass.
Reimplemented in Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
The base URL of the server.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::setLogger | ( | ?LoggerInterface | $logger | ) |
Set the log channel, for debugging.
?LoggerInterface | $logger |
Wikimedia\Parsoid\Config\SiteConfig::solTransparentWikitextNoWsRegexp | ( | bool | $addIncludes = false | ) |
A regex matching a line containing just comments and sol transparent links and behavior switches.
bool | $addIncludes |
Wikimedia\Parsoid\Config\SiteConfig::solTransparentWikitextRegexp | ( | ) |
A regex matching a line containing just whitespace, comments, and sol transparent links and behavior switches.
|
abstract |
Get the default local name for a special page.
string | $alias | Special page alias |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::tagNeedsNowikiStrippedInTagPF | ( | string | $lowerTagName | ) |
string | $lowerTagName |
Wikimedia\Parsoid\Config\SiteConfig::tidyWhitespaceBugMaxLength | ( | ) |
Maximum run length for Tidy whitespace bug.
Reimplemented in Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
The wiki's time zone offset.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
Wikimedia\Parsoid\Config\SiteConfig::ucfirst | ( | string | $str | ) |
Uppercasing method for titles.
string | $str |
|
final |
Unregister a Parsoid extension module.
This is typically used only for testing purposes in order to reset a shared SiteConfig to its original configuration.
int | $extId | The value returned by the call to ::registerExtensionModule() |
|
protected |
string | $func | |
string | $magicword | |
bool | $caseSensitive |
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Language variant information.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, and Wikimedia\Parsoid\Mocks\MockSiteConfig.
|
abstract |
Default thumbnail width.
Reimplemented in Wikimedia\Parsoid\Config\Api\SiteConfig, Wikimedia\Parsoid\Mocks\MockSiteConfig, and Wikimedia\Parsoid\ParserTests\SiteConfig.
|
protected |
@phan-var array<string,int>
|
protected |
@phan-var array<string,int>