summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0e69943)
Assume whitespace is safe to be wrapped anywhere. Exceptions could still
occur inside of tags, but deemed very unlikely. Rather have large code
blobs be counted as separate characters.
var pagename = window.location.pathname.replace(/\/$/, '/index');
var body = editor.getData().replace(/^(\t*).{73,}/mg, function (line, indent) {
// wrap long line after each sentence
var pagename = window.location.pathname.replace(/\/$/, '/index');
var body = editor.getData().replace(/^(\t*).{73,}/mg, function (line, indent) {
// wrap long line after each sentence
- var dot = '(?:[^<]|<[^>]*>)'; // one character
- var dots = '(?:'+dot+'{24,72}|'+dot+'{73,}?)'; // chars before punctuation
- var wrap = new RegExp('('+dots+'[.;:!?]) (?=[A-Z])', 'g'); // separate lines
+ 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');
});
var data = 'body='+encodeURIComponent(body);
return line.replace(wrap, '$1\n'+indent+'\t');
});
var data = 'body='+encodeURIComponent(body);