mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
add option: headerRegex
This commit is contained in:
parent
43ff0b643e
commit
e2be2d7d27
|
@ -52,7 +52,8 @@ showdown.subParser('headers', function (text, options, globals) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function headerId(m) {
|
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]) {
|
if (globals.hashLinkCounts[escapedId]) {
|
||||||
title = escapedId + '-' + (globals.hashLinkCounts[escapedId]++);
|
title = escapedId + '-' + (globals.hashLinkCounts[escapedId]++);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user