From e2be2d7d27b3625aae9f8605d8f5210ee4cae21e Mon Sep 17 00:00:00 2001 From: Julien Bisconti Date: Fri, 30 Dec 2016 16:53:13 +0200 Subject: [PATCH] add option: headerRegex --- src/subParsers/headers.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/subParsers/headers.js b/src/subParsers/headers.js index a6018f5..8dd52e8 100644 --- a/src/subParsers/headers.js +++ b/src/subParsers/headers.js @@ -52,7 +52,8 @@ showdown.subParser('headers', function (text, options, globals) { }); function headerId(m) { - var title, escapedId = m.replace(/[^\w]/g, '').toLowerCase(); + var regex = option.headerRegex || /[^\w]/g; + var title, escapedId = m.replace(regex, '').toLowerCase(); if (globals.hashLinkCounts[escapedId]) { title = escapedId + '-' + (globals.hashLinkCounts[escapedId]++);