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;