Expand all

ve.dm.MWWikitextSurfaceFragment

Extends

Constructor

new ve.dm.MWWikitextSurfaceFragment(doc) #

DataModel MWWikitextSurfaceFragment.

Parameters:

Name Type Description
doc ve.dm.Document
Source:
DataModel MWWikitextSurfaceFragment.

Methods

hasMatchingAncestor() #

unwrapText(before, after) → {ve.dm.MWWikitextSurfaceFragment}chainable #

Unwrap a fixed amount of text

Parameters:

Name Type Description
before number

Amount of text to remove from start

after number

Amount of text to remove from end

Source:

Returns:

Type
ve.dm.MWWikitextSurfaceFragment
Unwrap a fixed amount of text

wrapText(before, after, placeholder, [forceWrap]) → {ve.dm.MWWikitextSurfaceFragment}chainable #

Wrap a text selection.

If the selection is already identically wrapped it will be unwrapped.

Parameters:

Name Type Attributes Default Description
before string

Text to go before selection

after string

Text to go after selection

placeholder function | string

Placeholder text to insert at an empty selection

forceWrap boolean optional
false

Force wrapping, even if matching wrapping exists

Source:

Returns:

Type
ve.dm.MWWikitextSurfaceFragment
Wrap a text selection.