mirror of
https://github.com/wekan/wekan.git
synced 2026-02-08 01:14:21 +01:00
Changed markdown from marked to markdown-it. Added emoji support https://github.com/wekan/wekan/wiki/Emoji
Thanks to xet7 ! Fixes #2696, fixes #1537
This commit is contained in:
parent
e0957f70e6
commit
20b0177105
14 changed files with 54 additions and 9038 deletions
|
|
@ -1,9 +0,0 @@
|
|||
import marked from '../marked/lib/marked.js';
|
||||
|
||||
marked.setOptions({
|
||||
gfm: true,
|
||||
tables: true,
|
||||
breaks: true,
|
||||
});
|
||||
|
||||
Markdown = marked;
|
||||
|
|
@ -1,4 +1,13 @@
|
|||
import sanitizeXss from 'xss';
|
||||
var Markdown = require('markdown-it')({
|
||||
html: true,
|
||||
linkify: true,
|
||||
typographer: true,
|
||||
breaks: true,
|
||||
});
|
||||
|
||||
var emoji = require('markdown-it-emoji');
|
||||
Markdown.use(emoji);
|
||||
|
||||
if (Package.ui) {
|
||||
const Template = Package.templating.Template;
|
||||
|
|
@ -13,6 +22,6 @@ if (Package.ui) {
|
|||
text = Blaze._toText(self.templateContentBlock, HTML.TEXTMODE.STRING);
|
||||
}
|
||||
|
||||
return HTML.Raw(sanitizeXss(Markdown(text)));
|
||||
return HTML.Raw(sanitizeXss(Markdown.render(text)));
|
||||
}));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue