goodreadsReply

Quote only the selected text on a Goodreads comment reply; allow user to use Markdown

نووسەر
auspex
Daily installs
0
Total installs
22
Ratings
1 0 0
وەشان
0.6.3
Created
2017-02-07
Updated
2017-04-25
Size
2.86 KB
مۆڵەت
نییە
Applies to

In GoodReads comments, allow the user to choose the text they wanted to quote. This javascript attaches a click handler to every "reply" link that will either quote the selected text in the comment, or the first 200 characters (the GoodReads default).

You may now use markdown (* or _ surround a word or phrase for italics; two *s or _s for bold, and numerous other possibilities).

Because Showdown wraps paragraphs in <p> tags, and GoodReads makes comments within <p> tags look different from other comment text, I strip those tags from the result. This could, however, cause you to lose some formatting if you are used to using <p> tags. Also, GoodReads doesn't support many things in Markdown (like bulleted lists), so you may have to escape some constructs (lines beginning "* ", for instance, will need to use "\* "). Sorry about that, but I'm not sure there's much I can do about it. Possibly I can create a ShowDown extension to suppress processing lists and any other unusable Markdown, but that's for another day.