Greasy Fork

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.9 KB
许可证
暂无
适用于

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.