Fix quoting text selection when a quote is inlined. close #268
This commit is contained in:
parent
579b425cae
commit
66648b0f17
@ -1628,7 +1628,7 @@
|
||||
return QR.submit();
|
||||
},
|
||||
quote: function(e, blank) {
|
||||
var i, id, qr, s, sel, ss, ta, text, tid, v, _base, _ref, _ref2;
|
||||
var bq, i, id, qr, s, sel, ss, ta, text, tid, v, _base, _ref;
|
||||
if (e != null) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@ -1636,7 +1636,8 @@
|
||||
id = this.textContent;
|
||||
text = ">>" + id + "\n";
|
||||
sel = getSelection();
|
||||
if (id === ((_ref2 = $.x('preceding::input[@type="checkbox"][1]', sel.anchorNode)) != null ? _ref2.name : void 0)) {
|
||||
bq = $.x('ancestor::blockquote', sel.anchorNode);
|
||||
if (id === $.x('preceding-sibling::input', bq).name) {
|
||||
if (s = sel.toString().replace(/\n/g, '\n>')) {
|
||||
text += ">" + s + "\n";
|
||||
}
|
||||
|
||||
@ -1215,7 +1215,8 @@ QR =
|
||||
id = @textContent
|
||||
text = ">>#{id}\n"
|
||||
sel = getSelection()
|
||||
if id == $.x('preceding::input[@type="checkbox"][1]', sel.anchorNode)?.name
|
||||
bq = $.x('ancestor::blockquote', sel.anchorNode)
|
||||
if id == $.x('preceding-sibling::input', bq).name
|
||||
if s = sel.toString().replace /\n/g, '\n>'
|
||||
text += ">#{s}\n"
|
||||
{qr} = QR
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user