diff --git a/anchor-markdown-header.js b/anchor-markdown-header.js index 6c8dcdd..70cd652 100644 --- a/anchor-markdown-header.js +++ b/anchor-markdown-header.js @@ -21,6 +21,8 @@ function basicGithubId(text) { return text.replace(/ /g,'-') // escape codes .replace(/%([abcdef]|\d){2,2}/ig, '') + // html tags that are removed + .replace(/(<([^>]+)>)/gi, '') // single chars that are removed .replace(/[\/?!:\[\]`.,()*"';{}+=<>~\$|#@&–—]/g,'') // CJK punctuations that are removed diff --git a/test/anchor-markdown-header.js b/test/anchor-markdown-header.js index 0f28e44..3688f28 100644 --- a/test/anchor-markdown-header.js +++ b/test/anchor-markdown-header.js @@ -30,7 +30,7 @@ test('\ngenerating anchor in github mode', function (t) { , [ 'remove {curly braces}{}', null, '#remove-curly-braces'], , [ 'remove ++++pluses+', null, '#remove-pluses'] , [ 'remove escape codes %3Cstatic%E3 coreappupevents %E2%86%92 object', null, '#remove-escape-codes-static-coreappupevents--object'] - , [ 'remove lt and gt mycall', null, '#remove-lt-and-gt-staticmycall'] + , [ 'remove lt and gt mycall', null, '#remove-lt-and-gt-mycall'] , [ 'remove exclamation point!', null, '#remove-exclamation-point'] , [ 'remove = sign', null, '#remove--sign'] , [ '`history [pgn | alg]`', null, '#history-pgn--alg']