Expand all

ve.dm.MWInternalLinkAnnotation

Extends

Constructor

new ve.dm.MWInternalLinkAnnotation(element) #

DataModel MediaWiki internal link annotation.

Example HTML sources:

<a rel="mw:WikiLink">

Parameters:

Name Type Description
element Object
Source:
DataModel MediaWiki internal link annotation.

Methods

getComparableHtmlAttributes() #

getFragment() → {string} #

Convenience wrapper for .getFragment() on the current element.

Source:
See:

Returns:

Fragment for the title, or an empty string if it was invalid

Type
string
Convenience wrapper for .getFragment() on the current element.

dataElementFromTitle(title) → {Object}static #

Build element from a given mw.Title and raw title

Parameters:

Name Type Description
title mw.Title

The title to link to.

Source:

Returns:

The element.

Type
Object
Build element from a given mw.Title and raw title

getFragment(original) → {string|null}static #

Get the fragment for a title

Parameters:

Name Type Description
original string | mw.Title

Original title

Source:

Returns:

Fragment for the title, or null if it was invalid or missing

Type
string | null
Get the fragment for a title

getLookupTitle(original) → {string}static #

Normalize title for lookup (search suggestion, existence) purposes.

Parameters:

Name Type Description
original string | mw.Title

Original title

Source:

Returns:

Normalized title, or the original string if it is invalid

Type
string
Normalize title for lookup (search suggestion, existence) purposes.

newFromTitle(title) → {ve.dm.MWInternalLinkAnnotation}static #

Build a ve.dm.MWInternalLinkAnnotation from a given mw.Title.

Parameters:

Name Type Description
title mw.Title

The title to link to.

Source:

Returns:

The annotation.

Type
ve.dm.MWInternalLinkAnnotation
Build a ve.dm.MWInternalLinkAnnotation from a given mw.Title.

normalizeTitle(original) → {string}static #

Normalize title for comparison purposes. E.g. capitalisation and underscores.

Parameters:

Name Type Description
original string | mw.Title

Original title

Source:

Returns:

Normalized title, or the original string if it is invalid

Type
string
Normalize title for comparison purposes.