From 32de0bdd561a073c4f1cf7385106bbfabcd049f8 Mon Sep 17 00:00:00 2001 From: inportb Date: Mon, 9 Dec 2024 23:07:54 -0500 Subject: [PATCH] Report line-collapsed formatting --- htdocs/RoutePatientReports.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/RoutePatientReports.vue b/htdocs/RoutePatientReports.vue index 3925e50..170a5b8 100644 --- a/htdocs/RoutePatientReports.vue +++ b/htdocs/RoutePatientReports.vue @@ -205,7 +205,7 @@ id: 'OR_PN:' + time.getTime() + ':' + x[2], emblem: 'emblem-notes', title: [x[4], x[5], '#' + x[2]], - detail: escape_html(x[6]) + detail: escape_html(collapse_lines(x[6])) }; }), loader: reportloader_chunk, @@ -412,6 +412,10 @@ return fn; } + function collapse_lines(s) { + return s.replace(/(\S)[^\S\r\n]+\r?\n([^\s\.,\/#!$%\^&\*;:=\-_`~])/g, '$1 $2').replace(/([\.,!;])\r?\n([^\s\.,\/#!$%\^&\*;:=\-_`~])/g, '$1 $2'); + } + const escape_div = document.createElement('div'); function escape_html(s) { escape_div.textContent = s;