Browse Source

try again

main
Nat Alison 6 years ago
parent
commit
901ee97a0a
  1. 6
      scripts/generateHeadingIDs.js

6
scripts/generateHeadingIDs.js

@ -31,9 +31,11 @@ function addHeaderID(line, slugger) {
if (/\{#[^}]+\}/.test(line)) { if (/\{#[^}]+\}/.test(line)) {
return line; return line;
} }
const headingText = stripLinks(line.slice(line.indexOf(' ')).trim()); const headingText = line.slice(line.indexOf(' ')).trim();
const headingLevel = line.slice(0, line.indexOf(' ')); const headingLevel = line.slice(0, line.indexOf(' '));
return `${headingLevel} ${headingText} {#${slugger.slug(headingText)}}`; return `${headingLevel} ${headingText} {#${slugger.slug(
stripLinks(headingText),
)}}`;
} }
function addHeaderIDs(lines) { function addHeaderIDs(lines) {

Loading…
Cancel
Save