Parsoid
A bidirectional parser between wikitext and HTML5
|
Public Member Functions | |
getInterwiki () | |
The interwiki component of this LinkTarget. | |
getKey () | |
Get the DBkey, prefixed with interwiki prefix if any. | |
getDBkey () | |
Get the main part of the link target, in canonical database form. | |
getPrefixedDBKey () | |
Get the prefixed DBkey. | |
getPrefixedText () | |
Get the prefixed text. | |
getFullText () | |
Get the prefixed title with spaces, plus any fragment (part beginning with '#') | |
getFullDBKey () | |
Get the prefixed title with underscores, plus any fragment (part beginning with '#') | |
getNamespace () | |
Get the namespace ID. | |
getNamespaceName () | |
Get the human-readable name for the namespace (with spaces, not underscores). | |
getFragment () | |
Get the link fragment in text form (i.e. | |
equals (Title $title) | |
Compare with another title. | |
isSpecialPage () | |
Returns true if this is a special page. | |
createFragmentTarget (string $fragment) | |
Create a new LinkTarget with a different fragment on the same page. | |
Public Member Functions inherited from Wikimedia\Parsoid\Core\LinkTarget | |
inNamespace (int $ns) | |
Convenience function to check if the target is in a given namespace. | |
hasFragment () | |
Whether the link target has a fragment. | |
getText () | |
Get the main part of the link target, in text form. | |
isExternal () | |
Whether this LinkTarget has an interwiki component. | |
isSameLinkAs (LinkTarget $other) | |
Check whether the given LinkTarget refers to the same target as this LinkTarget. | |
__toString () | |
Return an informative human-readable representation of the link target, for use in logging and debugging. | |
Static Public Member Functions | |
static | newFromText (string $title, SiteConfig $siteConfig, ?int $defaultNs=null) |
static | fixSpecialName (SiteConfig $siteConfig, string $title) |
Use the default special page alias. | |
static | newFromLinkTarget (LinkTarget $linkTarget, SiteConfig $siteConfig) |
Convert LinkTarget from core (or other implementation) into a Parsoid Title. | |
Wikimedia\Parsoid\Utils\Title::createFragmentTarget | ( | string | $fragment | ) |
Create a new LinkTarget with a different fragment on the same page.
It is expected that the same type of object will be returned, but the only requirement is that it is a LinkTarget.
string | $fragment | The fragment override, or "" to remove it. |
Implements Wikimedia\Parsoid\Core\LinkTarget.
Wikimedia\Parsoid\Utils\Title::equals | ( | Title | $title | ) |
Compare with another title.
Title | $title |
|
static |
Use the default special page alias.
SiteConfig | $siteConfig | |
string | $title |
Wikimedia\Parsoid\Utils\Title::getDBkey | ( | ) |
Get the main part of the link target, in canonical database form.
The main part is the link target without namespace prefix or hash fragment. The database form means that spaces become underscores, this is also used for URLs.
Implements Wikimedia\Parsoid\Core\LinkTarget.
Wikimedia\Parsoid\Utils\Title::getFragment | ( | ) |
Get the link fragment in text form (i.e.
the bit after the hash #
).
Implements Wikimedia\Parsoid\Core\LinkTarget.
Wikimedia\Parsoid\Utils\Title::getFullDBKey | ( | ) |
Get the prefixed title with underscores, plus any fragment (part beginning with '#')
Wikimedia\Parsoid\Utils\Title::getFullText | ( | ) |
Get the prefixed title with spaces, plus any fragment (part beginning with '#')
Wikimedia\Parsoid\Utils\Title::getInterwiki | ( | ) |
The interwiki component of this LinkTarget.
This is the empty string if there is no interwiki component.
Implements Wikimedia\Parsoid\Core\LinkTarget.
Wikimedia\Parsoid\Utils\Title::getKey | ( | ) |
Get the DBkey, prefixed with interwiki prefix if any.
This is Parsoid's convention, which differs from core; use ::getDBkey() for a method compatible with core's convention.
Wikimedia\Parsoid\Utils\Title::getNamespace | ( | ) |
Wikimedia\Parsoid\Utils\Title::getNamespaceName | ( | ) |
Get the human-readable name for the namespace (with spaces, not underscores).
Wikimedia\Parsoid\Utils\Title::getPrefixedDBKey | ( | ) |
Get the prefixed DBkey.
Wikimedia\Parsoid\Utils\Title::getPrefixedText | ( | ) |
Get the prefixed text.
Wikimedia\Parsoid\Utils\Title::isSpecialPage | ( | ) |
Returns true if this is a special page.
|
static |
Convert LinkTarget from core (or other implementation) into a Parsoid Title.
LinkTarget | $linkTarget |