mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 13:47:33 +01:00
Issue 12033 - Use version of habitica-markdown that includes mentions (#12089)
* Issue 12033 - Use version of habitica-markdown that includes mention plugin Also fixes frontend parts of 11504 and 10924 * Issue 12033 - Reduce duplication in chatCard & messageCard * Issue 12033 - Use habitica-markdown version 2.0.0 * Issue 12033 - Use new entry point and fix tests * Issue 12033 - Rename renderMarkdown to renderWithMentions
This commit is contained in:
7
website/client/src/libs/renderWithMentions.js
Normal file
7
website/client/src/libs/renderWithMentions.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import habiticaMarkdown from 'habitica-markdown/withMentions';
|
||||
|
||||
export default function renderWithMentions (text, user) {
|
||||
if (!text) return null;
|
||||
const env = { userName: user.auth.local.username, displayName: user.profile.name };
|
||||
return habiticaMarkdown.render(String(text), env);
|
||||
}
|
||||
Reference in New Issue
Block a user