From fb2192d531d026589f3b5f889f4640feb6a26d45 Mon Sep 17 00:00:00 2001 From: Emanuele Bertoldi Date: Sun, 29 Apr 2018 12:14:06 +0200 Subject: [PATCH] Update index.js Resolve TypeError if title is not a string. --- lib/util/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/index.js b/lib/util/index.js index 01ef6ac77f..cf10c1f2dc 100644 --- a/lib/util/index.js +++ b/lib/util/index.js @@ -1,6 +1,6 @@ const parseEmojis = str => { const emojiData = require('markdown-it-emoji/lib/data/full.json') - return str.replace(/:(.+?):/g, (placeholder, key) => emojiData[key] || placeholder) + return String(str).replace(/:(.+?):/g, (placeholder, key) => emojiData[key] || placeholder) } exports.normalizeHeadTag = tag => {