TextEditor

TextEditor

A collection of helper functions and utility methods related to the rich text editor

Constructor

new TextEditor()

Source:

Methods

Source:

Replace a matched Entity Link with an actual HTML link to that entity Be failure-tolerant, allowing for the possibility that the entity does not exist

Parameters:
Name Type Description
match string

The full matched string

id string

The Entity ID or name

name name

A custom text name to display

Returns:

The replacement string

Type
string
Source:

Replace a matched Entity Link with an actual HTML link to that entity Be failure-tolerant, allowing for the possibility that the entity does not exist

Parameters:
Name Type Description
match string

The full matched string

entityType string

The named type of Entity being embedded

id string

The Entity ID or name

name name

A custom text name to display

Returns:

The replacement string

Type
string
Source:

Replace a hyperlink-like string with an actual HTML tag

Returns:

The replacement string

Type
String

(static) create(options, content) → {tinyMCE.Editor}

Source:

Create a Rich Text Editor. The current implementation uses TinyMCE

Parameters:
Name Type Description
options Object

Configuration options provided to the Editor init

content string

Initial HTML or text content to populate the editor with

Returns:

The editor instance.

Type
tinyMCE.Editor

(static) enrichHTML(content, secrets, entities, links) → {String}

Source:

Enrich HTML content by replacing or augmenting components of it

Parameters:
Name Type Description
content String

The original HTML content (as a string)

secrets Boolean

Remove secret tags?

entities Boolean

Replace dynamic entity links?

links Boolean

Replace hyperlink content?

Returns:

The enriched HTML content

Type
String