Parsoid
A bidirectional parser between wikitext and HTML5
|
Lightweight title class. More...
Public Member Functions | ||||
getNamespace () | ||||
Get the namespace index.
| ||||
getFragment () | ||||
Get the link fragment in text form (i.e.the bit after the hash # ).
| ||||
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.
| ||||
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.
| ||||
getInterwiki () | ||||
The interwiki component of this LinkTarget.
| ||||
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 | tryNew (int $namespace, string $title, string $fragment='', string $interwiki='') |
Constructs a TitleValue, or returns null if the parameters are not valid. | |
Lightweight title class.
Wikimedia\Parsoid\Utils\TitleValue::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\TitleValue::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\TitleValue::getFragment | ( | ) |
Get the link fragment in text form (i.e.the bit after the hash #
).
Implements Wikimedia\Parsoid\Core\LinkTarget.
Wikimedia\Parsoid\Utils\TitleValue::getInterwiki | ( | ) |
The interwiki component of this LinkTarget.
Implements Wikimedia\Parsoid\Core\LinkTarget.
Wikimedia\Parsoid\Utils\TitleValue::getNamespace | ( | ) |
|
static |
Constructs a TitleValue, or returns null if the parameters are not valid.
int | $namespace | The namespace ID. This is not validated. |
string | $title | The page title in either DBkey or text form. No normalization is applied beyond underscore/space conversion. |
string | $fragment | The fragment title. Use '' to represent the whole page. No validation or normalization is applied. |
string | $interwiki | The interwiki component. No validation or normalization is applied. |