Expand all

ve.ui.LinkAction

Extends

Constructor

new ve.ui.LinkAction(surface, [source]) #

Link action. This action transforms or inspects links (or potential links).

Parameters:

Name Type Attributes Description
surface ve.ui.Surface

Surface to act on

source string optional
Source:
Link action.

Properties

autolinkRegExpprivatestatic #

Properties:

Name Type Description
RegExp RegExp

matching an autolink + trailing space.

Source:

Methods

Autolink the selection, which may have trailing whitespace.

autolinkUrl() → {boolean} #

Autolink the selected URL (which may have trailing whitespace).

Source:

Returns:

True if the selection is a valid URL and the autolink action was executed; otherwise false.

Type
boolean
Autolink the selected URL (which may have trailing whitespace).

getLinkAnnotation(linktext) → {ve.dm.LinkAnnotation} #

Return an appropriate annotation for the given link text.

Parameters:

Name Type Description
linktext string

The link text to annotate.

Source:

Returns:

The annotation to use.

Type
ve.dm.LinkAnnotation
Return an appropriate annotation for the given link text.

getTrailingPunctuation(candidate) → {RegExp} #

Return an appropriate "trailing punctuation" set, which will get stripped from possible autolinks.

Parameters:

Name Type Description
candidate string

The candidate text. Some users may not wish to include closing brackets/braces/parentheses in the stripped character class if an opening bracket/brace/parenthesis in present in the candidate link text.

Source:

Returns:

A regular expression matching trailing punctuation which will be stripped from an autolink.

Type
RegExp

Return an appropriate "trailing punctuation" set, which will get stripped from possible autolinks.