forked from leftypol/leftypol
Improve citing in replies
This commit is contained in:
parent
46d62584d0
commit
1864530b56
1 changed files with 6 additions and 3 deletions
|
@ -322,10 +322,13 @@ function citeReply(id, with_link) {
|
||||||
var select = document.getSelection().toString();
|
var select = document.getSelection().toString();
|
||||||
if (select) {
|
if (select) {
|
||||||
var body = $('#reply_' + id + ', #op_' + id).find('div.body'); // TODO: support for OPs
|
var body = $('#reply_' + id + ', #op_' + id).find('div.body'); // TODO: support for OPs
|
||||||
var index = body.text().indexOf(select.replace('\n', '')); // for some reason this only works like this
|
// commenting out this condition, not sure of the purpose and gets in the way of citing
|
||||||
if (index > -1) {
|
// var index = body.text().indexOf(select.replace('\n', '')); // for some reason this only works like this
|
||||||
|
// if (index > -1) {
|
||||||
|
// quote each line in the selection
|
||||||
|
select = select.replace(/\n(.)/g, '\n>$1');
|
||||||
textarea.value += '>' + select + '\n';
|
textarea.value += '>' + select + '\n';
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
$(window).trigger('cite', [id, with_link]);
|
$(window).trigger('cite', [id, with_link]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue