Commit Graph

4 Commits

Author SHA1 Message Date
Bart Enkelaar
ef99943646 Don't break up links with user profile link injections (#12100)
* Issue 10924 - Don't break up links with mention links

* Issue 10924 - Recognise links between brackets.

* Issue 10924 - Rely on markdown parser for link determination

* Issue 10924 - Only increment index once in findTextBlocks
2020-05-09 19:37:08 +02:00
Bart Enkelaar
ec5de91123 Issue 12138 - Fix chat support for regex chars in code blocks 2020-04-27 20:24:59 +02:00
Matteo Pagliazzi
188023b197 fix #12118: pass mandatory second parameter to markdown-it parse method 2020-04-24 12:06:05 +02:00
Bart Enkelaar
9608b9fa9f Don't link user in markdown code blocks - Fixes #[11504] (#12069)
* Improve whitespacing in highlightMentions.js unit test

* Issue 11504 - Don't link users in markdown code blocks

Use the markdown-it parser to determine what parts of the message are code block first.
Then work from those parser tokens back to content parts that should not be handled.

Still convoluted, but can be improved once a "user mention plugin" is added to habitica-markdown.

* Issue 11504 - Put functions in JavaScript order and fix linting issues

* Issue 11504 - Use includes i.o. multiple or checks and added some context.

* Issue 11504 - Add docstring for highlightMentions and simplify fence regex

* Issue 11504 - Replace inline recursor with default parameter value
2020-04-17 22:19:11 +02:00