From 49f63310751dc7bde87e65180f0fe087d7427783 Mon Sep 17 00:00:00 2001 From: Soreine Date: Tue, 8 Nov 2016 15:13:38 +0100 Subject: [PATCH] Add marks option to Text.createFromString --- src/models/text.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 } }) ) })