mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
* 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
8 lines
289 B
JavaScript
8 lines
289 B
JavaScript
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);
|
|
}
|