WatchPeopleCode icon indicating copy to clipboard operation
WatchPeopleCode copied to clipboard

Basic chat formatting. (Markdown bold and italic)

Open gkbrk opened this issue 10 years ago • 2 comments

Tested on Firefox.

gkbrk avatar Jun 21 '15 19:06 gkbrk

Hm, that's quite non-standard, e.g. bold could be done using two underscores. I think it'd be better to use some lib, e.g. this one: https://github.com/chjj/marked

eleweek avatar Jun 21 '15 23:06 eleweek

I made it so it matches **this** and __this__ for bold, *this* and _this_ for italic. This seems to be how most implementations work. I was going to use the library but adding a 1285 line library for what can be done with 2 lines of code seemed like a waste.

Since we store the markdown in the database before converting to html, we can always switch to the library if we want more markdown features.

Here's the library code in case we need the relevant lines for bold and italic text.

gkbrk avatar Jun 22 '15 18:06 gkbrk