Extends
Constructor
new ve.dm.MWWikitextSurfaceFragment(doc)
#
DataModel MWWikitextSurfaceFragment.
Methods
convertFromSource()
#
convertToSource()
#
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 |
Returns:
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 |
Returns:
Wrap a text selection.