diff --git a/4chan_x.coffee b/4chan_x.coffee index f071ec5a7..0d7943235 100644 --- a/4chan_x.coffee +++ b/4chan_x.coffee @@ -622,7 +622,8 @@ qrText = (link) -> selection = window.getSelection() id = x('preceding::span[@id][1]', selection.anchorNode)?.id - text += '>' + selection.toString() if id is link.parentNode.id + if (s = selection.toString()) and (id is link.parentNode.id) + text += ">#{s}" text diff --git a/4chan_x.js b/4chan_x.js index b74eec9a1..dca0bd6e7 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -791,12 +791,12 @@ return quickReply(link, text); }; qrText = function(link) { - var id, selection, text, _ref; + var id, s, selection, text, _ref; text = '>>' + link.parentNode.id.match(/\d+$/)[0] + '\n'; selection = window.getSelection(); id = (_ref = x('preceding::span[@id][1]', selection.anchorNode)) != null ? _ref.id : void 0; - if (id === link.parentNode.id) { - text += '>' + selection.toString(); + if ((s = selection.toString()) && (id === link.parentNode.id)) { + text += ">" + s; } return text; };