diff --git a/lib/util/parseHeaders.js b/lib/util/parseHeaders.js index 8fbf18ac95..2a2c4fee4c 100644 --- a/lib/util/parseHeaders.js +++ b/lib/util/parseHeaders.js @@ -1,16 +1,16 @@ 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) } -const unescapeHtml = html => html +const unescapeHtml = html => String(html) .replace(/"/g, '"') .replace(/'/g, '\'') .replace(/:/g, ':') .replace(/</g, '<') .replace(/>/g, '>') -const removeMarkdownToken = str => str +const removeMarkdownToken = str => String(str) .replace(/`(.*)`/, '$1') // `` .replace(/\[(.*)\]\(.*\)/, '$1') // []() .replace(/\*\*(.*)\*\*/, '$1') // **