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:
Bart Enkelaar
2020-05-09 20:04:14 +02:00
committed by GitHub
parent ef99943646
commit c218b8d56c
9 changed files with 44 additions and 67 deletions

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