mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
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
This commit is contained in:
@@ -22,7 +22,7 @@ import guildsAllowingBannedWords from '../../libs/guildsAllowingBannedWords';
|
||||
import { getMatchesByWordArray } from '../../libs/stringUtils';
|
||||
import bannedSlurs from '../../libs/bannedSlurs';
|
||||
import apiError from '../../libs/apiError';
|
||||
import { highlightMentions } from '../../libs/highlightMentions';
|
||||
import highlightMentions from '../../libs/highlightMentions';
|
||||
|
||||
const FLAG_REPORT_EMAILS = nconf.get('FLAG_REPORT_EMAIL').split(',').map(email => ({ email, canSend: true }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user