diff --git a/package.json b/package.json index c9e24747..6011ec8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "inkjs", - "version": "2.2.0", + "version": "2.2.1", "description": "A javascript port of inkle's ink scripting language (http://www.inklestudios.com/ink/)", "main": "dist/ink-full.js", "types": "ink.d.ts", diff --git a/src/engine/StoryState.ts b/src/engine/StoryState.ts index 36608531..9a42fa6d 100644 --- a/src/engine/StoryState.ts +++ b/src/engine/StoryState.ts @@ -827,7 +827,10 @@ export class StoryState { if (tailLastNewlineIdx < str.length - 1) { let numSpaces = str.length - tailLastNewlineIdx - 1; let trailingSpaces = new StringValue( - str.substring(tailLastNewlineIdx + 1, numSpaces) + str.substring( + tailLastNewlineIdx + 1, + tailLastNewlineIdx + 1 + numSpaces + ) ); listTexts.push(trailingSpaces); }