Skip to content

Commit

Permalink
fix: title cannot be number at front matter (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
ulivz committed Apr 30, 2018
1 parent 565894f commit 5023d19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/util/parseHeaders.js
Original file line number Diff line number Diff line change
@@ -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(/&lt;/g, '<')
.replace(/&gt;/g, '>')

const removeMarkdownToken = str => str
const removeMarkdownToken = str => String(str)
.replace(/`(.*)`/, '$1') // ``
.replace(/\[(.*)\]\(.*\)/, '$1') // []()
.replace(/\*\*(.*)\*\*/, '$1') // **
Expand Down

0 comments on commit 5023d19

Please sign in to comment.