Files
habitica/website/client/src/libs/renderWithMentions.js
Bart Enkelaar c218b8d56c 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
2020-05-09 20:04:14 +02:00

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);
}