diff --git a/src/models/text.js b/src/models/text.js index 5e821f900..9ccd69b00 100644 --- a/src/models/text.js +++ b/src/models/text.js @@ -48,15 +48,16 @@ class Text extends new Record(DEFAULTS) { * Create a new `Text` from a string * * @param {String} content + * @param {Set} marks (optional) * @return {Text} */ - static createFromString(content) { + static createFromString(content, marks = Set()) { return Text.create({ characters: Character.createList( content.split('') .map(c => { - return { text: c } + return { text: c, marks } }) ) })