diff --git a/CHANGELOG.md b/CHANGELOG.md index 10c1715..74b3022 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ## 2.0.3 ### Bug fixes +- fix: rendering emojis - fix: css var polyfill ## 2.0.2 diff --git a/src/render.js b/src/render.js index 36b8cf6..a01fc96 100644 --- a/src/render.js +++ b/src/render.js @@ -39,7 +39,7 @@ export function init () { renderer.code = function (code, lang = '') { const hl = Prism.highlight(code, Prism.languages[lang] || Prism.languages.markup) - return `
${hl.replace(/:/g, '__colon__')}`
+ return `${hl}`
}
renderer.link = function (href, title, text) {
if (!/:/.test(href)) {
diff --git a/src/util.js b/src/util.js
index c57bb42..d5b62ae 100644
--- a/src/util.js
+++ b/src/util.js
@@ -160,6 +160,7 @@ export const merge = Object.assign || function (to) {
export function emojify (text) {
return text
+ .replace(/<(pre|template)[^>]*?>([\s\S]+)<\/(pre|template)>/g, match => match.replace(/:/g, '__colon__'))
.replace(/:(\w*?):/ig, '