Expand all

private ve.dm.MWMagicLinkType

Constructor

new ve.dm.MWMagicLinkType(type, rel, content)private #

Encapsulation of a particular magic link type.

Parameters:

Name Type Description
type string

The type of magic link; one of 'ISBN', 'PMID', or 'RFC'.

rel string

The value of the link's "rel" attribute. Either 'mw:ExtLink' or 'mw:WikiLink'.

content string

The content of the magic link.

Source:
Encapsulation of a particular magic link type.

Methods

getCode()protected #

matchHref(href) → {boolean} #

Return true if the given href is appropriate for this magic link.

Parameters:

Name Type Description
href string
Source:

Returns:

Type
boolean
Return true if the given href is appropriate for this magic link.

fromContent(content) → {ve.dm.MWMagicLinkType|null}static #

Return the subclass of ve.dm.MWMagicLinkType appropriate for the given content, or null if the content is not appropriate for a magic link.

Parameters:

Name Type Description
content string
Source:

Returns:

Type
ve.dm.MWMagicLinkType | null

Return the subclass of ve.dm.MWMagicLinkType appropriate for the given content, or null if the content is not appropriate for a magic link.