Userscripts.org Quick Quote

By JoeSimmons Last update Aug 27, 2009 — Installed 522 times.

SUGGESTIONS

in
Subscribe to SUGGESTIONS 4 posts, 3 voices



Marti Scriptwright

  • REMINDER I know this says it does quick quoting... but lacking description on about page. What's it about? ... what's the allure?

 
JoeSimmons Script's Author

Marti wrote:
I know this says it does quick quoting... but lacking description on about page. What's it about? ... what's the allure?

The description is Adds a quote button to posts, even has selection quoting.
What's wrong with that? Sizzle's is even shorter than mine, even though they both get to the point.

 
sizzlemctwizzle Scriptwright
JoeSimmons wrote: What's wrong with that? Sizzle's is even shorter than mine, even though they both get to the point.
Script Summary:
Just select the text and click "Quote"
lol
 
JoeSimmons Script's Author

Now supports nested quoting. Sizzle take a look and see how I did it. And I used no code from you, pretty simple actually with a little regex knowledge.
It fixes the whitespace at the beginning of selected text too so it doesn't indent. It also fixes the empty <p> tag at the beginning of a selection. Here is how I fixed the quoted html (post var is quote on yours):

post = selectHTML().replace(/^(<p>\s*<\/p>)/g,'').replace(/^(\s*<br>\s*)*\s*/,'').replace(/^\s+/,'');

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel