Chunk
Type: Class
Represents a single 'chunk' of incompletely annotated text
Constructor arguments
text
(Required)
Type: String
The type of text the chunk represents
Properties
text
Type: String
The text content of this chunk. Mutate it in an input processor.
Methods
add Fallback
Type: Function
Set the fallBackfunction, used when converting back from the annotated text for a plain text import Add a fallbackFunction undoing every text change done. ie: originalText = '- A list item'
Other
// Execute a text change here, removing the '- '
text = 'A list item'
// Add the '- ' back when falling back to plain text
addFallback(function (chunk){ chunk.text = '- ' + chunk.text});
Arguments
add Label
Type: Function
Add a label for this chunk
Arguments
fallback
Type: Function
Fallback to the original version of the text, used for falling back to a plain text import
Returns