[dw-free] Trim extraneous whitespace when auto-quoting in comments
[commit: http://hg.dwscoalition.org/dw-free/rev/5e6c5d092470]
http://bugs.dwscoalition.org/show_bug.cgi?id=2190
Trim leading and trailing whitespace from selected text before quoting.
Patch by
kaisa.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2190
Trim leading and trailing whitespace from selected text before quoting.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/LJ/Talk.pm
- cgi-bin/weblib.pl
-------------------------------------------------------------------------------- diff -r 88262a5cf66e -r 5e6c5d092470 cgi-bin/LJ/Talk.pm --- a/cgi-bin/LJ/Talk.pm Thu Jun 10 18:54:44 2010 +0800 +++ b/cgi-bin/LJ/Talk.pm Thu Jun 10 19:01:12 2010 +0800 @@ -1781,6 +1781,8 @@ sub talkform { } else if (window.getSelection) { text = window.getSelection(); } + + text = text.replace(/^\\s+/, '').replace(/\\s+\$/, ''); if (text == '') { if (helped != 1 && pasted != 1) { diff -r 88262a5cf66e -r 5e6c5d092470 cgi-bin/weblib.pl --- a/cgi-bin/weblib.pl Thu Jun 10 18:54:44 2010 +0800 +++ b/cgi-bin/weblib.pl Thu Jun 10 19:01:12 2010 +0800 @@ -803,6 +803,8 @@ sub create_qr_div { } else if (window.getSelection) { text = window.getSelection(); } + + text = text.replace(/^\\s+/, '').replace(/\\s+\$/, ''); if (text == '') { if (helped != 1 && pasted != 1) { --------------------------------------------------------------------------------