From bfa74e02102ae1286b8b0b0fc2b969a37fcdef02 Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 13 Jul 2024 15:54:50 -0700 Subject: [PATCH] make getting notes a little cleaner in stat parser --- module/other/stat-parser-macro.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/module/other/stat-parser-macro.js b/module/other/stat-parser-macro.js index 1be9956..10acd86 100644 --- a/module/other/stat-parser-macro.js +++ b/module/other/stat-parser-macro.js @@ -138,15 +138,22 @@ function GetNotesFromInput(inputText) { try { if (results != null && results.length > 0) { - [notes] = results; - notes = notes.replace("\n", " "); + let output = ""; + + const lines = results[0].split(/\r?\n/); + + for (var i = 0; i < lines.length; i++) { + output += lines[i] + "
"; + } + + notes = output; } } catch (ex) { console.log("GetNotesFromInput Error"); console.log(ex); } - return notes; + return [notes]; } function GetArmorFromInput(inputText) {