goodreadsReply

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

लेखक
auspex
दैनिक इंस्टॉल
0
एकूण इंस्टॉल
22
रेटिंग
1 0 0
आवृत्ती
0.6.3
बनवली
2017-02-07
अपडेट केली
2017-04-25
आकार
2.86 KB
License
नाही
यांवर लागू होते:

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.