From 6a3cd6e608afe3725bbf345916b31c151c195186 Mon Sep 17 00:00:00 2001 From: Pierre Romera Date: Wed, 19 Jun 2024 14:17:55 +0000 Subject: [PATCH] fix: use new line boundaries Co-authored-by: Caroline Desprat --- main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.js b/main.js index e7ef167..97264b2 100644 --- a/main.js +++ b/main.js @@ -11,7 +11,7 @@ document.addEventListener('datashare:ready', ({ detail }) => { const toSentenceCase = str => { const sentences = tokenizer // Detect sentences using Sentence Boundary Detection (SBD) - .sentences(str, { preserve_whitespace: false, newline_boundaries: false }) + .sentences(str, { preserve_whitespace: false, newline_boundaries: true }) .map(sentence => { const sanitizedSentence = stripHtml(sentence) // Only if the string is all in uppercase