trim text selection when quoting.
This commit is contained in:
parent
fe47faebdc
commit
aa8a81fdcd
@ -1868,9 +1868,9 @@
|
||||
id = this.previousSibling.hash.slice(2);
|
||||
text = ">>" + id + "\n";
|
||||
sel = window.getSelection();
|
||||
if ((s = sel.toString()) && id === ((_ref = $.x('ancestor-or-self::blockquote', sel.anchorNode)) != null ? _ref.id.match(/\d+$/)[0] : void 0)) {
|
||||
if ((s = sel.toString().trim()) && id === ((_ref = $.x('ancestor-or-self::blockquote', sel.anchorNode)) != null ? _ref.id.match(/\d+$/)[0] : void 0)) {
|
||||
if ($.engine === 'presto') {
|
||||
s = d.getSelection();
|
||||
s = d.getSelection().trim();
|
||||
}
|
||||
s = s.replace(/\n/g, '\n>');
|
||||
text += ">" + s + "\n";
|
||||
|
||||
@ -1434,9 +1434,9 @@ QR =
|
||||
text = ">>#{id}\n"
|
||||
|
||||
sel = window.getSelection()
|
||||
if (s = sel.toString()) and id is $.x('ancestor-or-self::blockquote', sel.anchorNode)?.id.match(/\d+$/)[0]
|
||||
if (s = sel.toString().trim()) and id is $.x('ancestor-or-self::blockquote', sel.anchorNode)?.id.match(/\d+$/)[0]
|
||||
# XXX Opera needs d.getSelection() to retain linebreaks from the selected text
|
||||
s = d.getSelection() if $.engine is 'presto'
|
||||
s = d.getSelection().trim() if $.engine is 'presto'
|
||||
s = s.replace /\n/g, '\n>'
|
||||
text += ">#{s}\n"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user