Commit Graph

12 Commits

Author SHA1 Message Date
Quinton Lee
b13098a684 Formatter: fix linking text followed by > (#4222) 2017-12-07 16:13:35 -06:00
Guangcong Luo
1d41e73199 Formatter: Change rel="noopener" output
The client now interprets `rel="noopener"` to mean "check links for
interstice whitelist", and bypasses the interstice if it's not there.

This is is the best approach for [[google links]] to bypass the
interstice, while not whitelisting all of Google because Google
redirects are not generally trustworthy.
2017-11-28 09:53:21 -06:00
Bär Halberkamp
5b542c5f4c Formatter: re-implement [[pokemon: name]] and [[item: name]] 2017-11-28 16:34:48 +01:00
Guangcong Luo
fda5ab4fcc Support paren spans in chat formatter
This mainly adds support for parenthetical spoilers:

(parenthetical spoiler: these)

They'll be useful for closing any other autoclosing spans in the
future, but currently spoiler is the only one.
2017-11-28 08:34:21 -06:00
Guangcong Luo
3c5b4ca0fb Formatter: Fix parsing for [[wiki: links]] 2017-11-28 08:34:21 -06:00
Guangcong Luo
d0f66895c3 Update text formatter link syntax
Now matches old link syntax [[Text <uri>]]

Also now supports alternate search engines [[wiki: Text]]
2017-11-28 07:59:51 -06:00
Guangcong Luo
45dd012840 Refactor chat-formatter main loop
The new loop makes the loop invariant a lot easier to enforce, although
it makes certain parts less readable.
2017-11-28 07:17:36 -06:00
Guangcong Luo
65517f279c Rewrite chat formatter
This new version supports significantly more client chat formatting
than before, and is more readable.

Also new: the `code` formatting now uses basically the same system as
Markdown, where you can use as many `` ` `` in a row as you want as
your delimiter.
2017-11-27 12:16:15 -06:00
Guangcong Luo
d1bf3737a8 Improve chat formatter tests 2017-10-30 21:51:37 -05:00
Guangcong Luo
3f3eaa1ac0 Formatter: Fix subscript parsing 2017-10-30 21:48:14 -05:00
Guangcong Luo
39b52e7dda Rename Chat.parseText -> Chat.formatText
(And move it to its own file, chat-formatter.js)
2017-10-30 21:41:59 -05:00
Guangcong Luo
0ccf846eab Add tests for Chat.parseText 2017-10-30 21:31:03 -05:00