edit/page: keep metadata headers unwrapped
authorMischa POSLAWSKY <perl@shiar.org>
Thu, 25 Mar 2021 02:29:13 +0000 (03:29 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 22 Sep 2021 14:47:31 +0000 (16:47 +0200)
Prefer all meta tags on the first line.

edit/page.js

index 3101ea1c134317d3f57bc66cad0b68226e8559d6..8aa2890b8d3c426c1155a0264ad7a04fb44e68b7 100644 (file)
@@ -22,6 +22,7 @@ CKEDITOR.plugins.add('inlinesave', {
                                body = body.replace(/\b((?:[Dd]hr|[Mm](?:w|e?vr|r|r?ss?)|[A-Z])\.)\s+(?=[A-Zdtv])/g, '$1&nbsp;');
                                // wrap long line after each sentence
                                body = body.replace(/^(\t*).{73,}/mg, function (line, indent) {
+                                       if (/^<meta /.test(line)) return line; // ignore metadata headers
                                        var dots = '(?:.{24,72}|.{73,}?)'; // chars before punctuation
                                        var wrap = new RegExp('('+dots+'[.:!?]) (?=[A-Z(<])', 'g'); // separate lines
                                        return line.replace(wrap, '$1\n'+indent+'\t');