mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Options to configure headers ID convertion
This commit is contained in:
parent
e2be2d7d27
commit
5b6cb068a2
BIN
dist/showdown.js
vendored
BIN
dist/showdown.js
vendored
Binary file not shown.
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
BIN
dist/showdown.min.js
vendored
BIN
dist/showdown.min.js
vendored
Binary file not shown.
BIN
dist/showdown.min.js.map
vendored
BIN
dist/showdown.min.js.map
vendored
Binary file not shown.
|
@ -52,8 +52,10 @@ showdown.subParser('headers', function (text, options, globals) {
|
|||
});
|
||||
|
||||
function headerId(m) {
|
||||
var regex = option.headerRegex || /[^\w]/g;
|
||||
var title, escapedId = m.replace(regex, '').toLowerCase();
|
||||
var regex = options.headerRegex || /[^\w]/g,
|
||||
replace = options.headerReplace || '',
|
||||
title,
|
||||
escapedId = m.replace(regex, replace).toLowerCase();
|
||||
|
||||
if (globals.hashLinkCounts[escapedId]) {
|
||||
title = escapedId + '-' + (globals.hashLinkCounts[escapedId]++);
|
||||
|
|
Loading…
Reference in New Issue
Block a user