From c195d2d1a6d5e94503d81afa6a3952c6eeb53b32 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Mon, 2 Oct 2017 13:26:36 +0800 Subject: [PATCH] fix(slugify): GitHub compatible heading links, fixed #267 --- src/core/render/slugify.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/render/slugify.js b/src/core/render/slugify.js index e37318f43..4b71337d5 100644 --- a/src/core/render/slugify.js +++ b/src/core/render/slugify.js @@ -4,8 +4,9 @@ const re = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,.\/:;<=>?@\[\]^`{|}~]/g export function slugify (str) { if (typeof str !== 'string') return '' + str = /^[\w\s]+$/g.test(str) ? str.toLowerCase() : str + let slug = str - .toLowerCase() .trim() .replace(/<[^>\d]+>/g, '') .replace(re, '')