mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Potential fix for #1004
This commit is contained in:
parent
49f76ffe76
commit
321782aa26
1 changed files with 6 additions and 11 deletions
17
vendors/squire/build/squire-raw.js
vendored
17
vendors/squire/build/squire-raw.js
vendored
|
|
@ -3470,21 +3470,16 @@ class Squire
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
let lines = plainText.split(/\r?\n/),
|
let lines = plainText.split(/\r?\n/),
|
||||||
closeBlock = '</' + blockTag + '>',
|
closeBlock = '</' + blockTag + '>',
|
||||||
openBlock = '<' + blockTag + '>',
|
openBlock = '<' + blockTag + '>';
|
||||||
i = lines.length,
|
|
||||||
line;
|
|
||||||
|
|
||||||
while (i--) {
|
lines.forEach((line, i) => {
|
||||||
line = escapeHTML(lines[i]).replace(/ (?=)/g, ' ');
|
line = escapeHTML(line).replace(/ (?=(?: |$))/g, NBSP);
|
||||||
// We don't wrap the first line in the block, so if it gets inserted
|
// We don't wrap the first line in the block, so if it gets inserted
|
||||||
// into a blank line it keeps that line's formatting.
|
// into a blank line it keeps that line's formatting.
|
||||||
// Wrap each line in <div></div>
|
// Wrap each line in <div></div>
|
||||||
if (i) {
|
lines[i] = i ? openBlock + (line || '<BR>') + closeBlock : line;
|
||||||
line = openBlock + (line || '<BR>') + closeBlock;
|
});
|
||||||
}
|
|
||||||
lines[i] = line;
|
|
||||||
}
|
|
||||||
return this.insertHTML(lines.join(''), isPaste);
|
return this.insertHTML(lines.join(''), isPaste);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue