mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-13 21:21:28 +02:00
feat(emoji): add emoji support in markdown
This commit is contained in:
@@ -92,6 +92,24 @@
|
||||
//},
|
||||
table: function (header, body) {
|
||||
return '<table class="table table-hover table-bordered table-condensed md-table margin-bottom-10"><thead>' + header + '</thead><tbody>' + body + '</tbody></table>';
|
||||
},
|
||||
text: function (text) {
|
||||
var RexStr = /:([A-Za-z0-9_\-\+]+?):/g;
|
||||
text = text.replace(RexStr, function (match, emoji) {
|
||||
return '<img src="'
|
||||
+ '/graphics/emojis/'
|
||||
+ encodeURIComponent(emoji)
|
||||
+ '.png"'
|
||||
+ ' alt="'
|
||||
+ emoji
|
||||
+ '"'
|
||||
+ ' title="'
|
||||
+ emoji
|
||||
+ '"'
|
||||
+ ' class="emoji" align="absmiddle" height="20" width="20">';
|
||||
});
|
||||
|
||||
return text;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user