Fix quoting OP, optimize. Kill two birds with in one stone.

This commit is contained in:
Nicolas Stepien 2011-12-11 18:38:10 +01:00
parent 2ed173f0a5
commit f28964138e
2 changed files with 2 additions and 2 deletions

View File

@ -1680,7 +1680,7 @@
text = ">>" + id + "\n"; text = ">>" + id + "\n";
selection = window.getSelection(); selection = window.getSelection();
if (s = selection.toString()) { if (s = selection.toString()) {
selectionID = (_ref = $.x('ancestor::blockquote', selection.anchorNode)) != null ? _ref.parentNode.firstElementChild.name : void 0; selectionID = (_ref = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)) != null ? _ref.name : void 0;
if (selectionID === id) { if (selectionID === id) {
s = s.replace(/\n/g, '\n>'); s = s.replace(/\n/g, '\n>');
text += ">" + s + "\n"; text += ">" + s + "\n";

View File

@ -1316,7 +1316,7 @@ qr =
selection = window.getSelection() selection = window.getSelection()
if s = selection.toString() if s = selection.toString()
selectionID = $.x('ancestor::blockquote', selection.anchorNode)?.parentNode.firstElementChild.name selectionID = $.x('ancestor::blockquote/preceding-sibling::input', selection.anchorNode)?.name
if selectionID is id if selectionID is id
s = s.replace /\n/g, '\n>' s = s.replace /\n/g, '\n>'
text += ">#{s}\n" text += ">#{s}\n"