From 16041ae0aecf01c7dc8e33571d70206be94a36dd Mon Sep 17 00:00:00 2001 From: Joshua Brown Date: Tue, 23 May 2017 14:33:43 -0700 Subject: [PATCH] add soft breaks to New Line logic (#1) In our application we sometimes get substation alpha authors that put n at the end of each line in the dialogue. Usually we would expect that they would use N instead. So we will add that to the conditions checked by the parse- newLine function so that this doesn' t cause a breaking behavior of actually printing out the literal n at the end of each line of dialogue. --- .gitignore | 2 ++ src/parser/parse.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cdfdf26..4117a54 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ /npm-debug.log /src/version.ts + +.idea diff --git a/src/parser/parse.ts b/src/parser/parse.ts index ec7a2f8..1fe9b7c 100644 --- a/src/parser/parse.ts +++ b/src/parser/parse.ts @@ -240,7 +240,7 @@ class ParserRun { parse_newline(parent: ParseNode): ParseNode | null { const current = new ParseNode(parent); - if (this.read(current, "\\N") === null) { + if (this.read(current, "\\N") === null && this.read(current, "\\n") === null) { parent.pop(); return null; }