From 98898356907ae911816047b127a47b5610d703ce Mon Sep 17 00:00:00 2001 From: andrewprivate <32175943+andrewprivate@users.noreply.github.com> Date: Thu, 17 Jul 2025 13:04:34 -0400 Subject: [PATCH] Pre-normalize line breaks when loading from text files Fixes #18 --- templates/js/ann_parser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/js/ann_parser.js b/templates/js/ann_parser.js index b291561..499ade9 100644 --- a/templates/js/ann_parser.js +++ b/templates/js/ann_parser.js @@ -30,7 +30,7 @@ var ann_parser = { /////////////////////////////////////////////////////// txt2ann: function(txt, dtd) { var ann = { - text: txt, + text: txt.replace(/\r\n/g, '\n').replace(/\r/g, '\n'), // normalize line breaks. XML automatically does CRLF to LF conversion dtd_name: dtd.name, tags: [], meta: {}, // the meta data of this annotation @@ -1083,4 +1083,4 @@ var ann_parser = { }, -}; \ No newline at end of file +};