Instance Method

replaceSelectionWithMarkupString:

Replaces the current selection with mixed text and markup.

Declaration

- (void)replaceSelectionWithMarkupString:(NSString *)markupString;

Parameters

markupString

The markup string that replaces the current selection.

Discussion

If the current selection is collapsed (a range is selected with the same nodes and offsets for the start and end) then no content is removed when inserting the markup, and the selection is collapsed and moved to the end of the inserted content. If no content is selected, the markup is not inserted.

See HTML Clipboard Format for a specification of the supported HTML markup.

See Also

Editing Documents

- replaceSelectionWithNode:

Replaces the receiver’s current selection with the specified DOM node.

- replaceSelectionWithText:

Replaces the current selection with a string of text.

- replaceSelectionWithArchive:

Replaces the current selection with an archive's contents.

- deleteSelection

Deletes the receiver’s current selection unless it’s collapsed.

- moveToBeginningOfSentence:

Moves the insertion point to the beginning of the current sentence.

- moveToBeginningOfSentenceAndModifySelection:

Moves the insertion point and extends the selection to the beginning of the current sentence.

- moveToEndOfSentence:

Moves the insertion point to the end of the current sentence.

- moveToEndOfSentenceAndModifySelection:

Moves the insertion point and extends the selection to the end of the current sentence.

- selectSentence:

Selects the entire sentence around the insertion point.

- toggleContinuousSpellChecking:

Toggles whether continuous spell checking is available.

- toggleSmartInsertDelete:

Toggles whether spaces around selected words are inserted or deleted to preserve proper spacing and punctuation.

canMakeTextStandardSize

A Boolean that indicates whether the current text size is a multiple of 1.

- makeTextStandardSize:

Resets the text size to a multiple of 1.

maintainsInactiveSelection

A Boolean that indicates whether the selection is maintained when focus is lost.