From 8da4e3db153de18c026cc8dda79bdc0947663c8a Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 1 Dec 2020 03:54:24 +0100 Subject: [PATCH] edit/page: input replacement of breaking space after abbreviations Clean up rule to prevent line breaks after common name titles. --- edit/page.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/edit/page.js b/edit/page.js index 4e389db..d1f16bf 100644 --- a/edit/page.js +++ b/edit/page.js @@ -8,6 +8,8 @@ CKEDITOR.plugins.add('inlinesave', { body = body.replace(/((?!

).{3})(?:\s|\u200B)+(?=<\/p>)/g, '$1'); // empty line is equivalent to a paragraph break body = body.replace(/
\s*
/g, '

'); + // keep names and preceding abbreviations together + body = body.replace(/\b((?:dhr|mw|me?vr|mr?s?)\.)\s+(?=[A-Z])/ig, '$1 '); // wrap long line after each sentence body = body.replace(/^(\t*).{73,}/mg, function (line, indent) { var dots = '(?:.{24,72}|.{73,}?)'; // chars before punctuation -- 2.30.0