diff --git a/src/index.js b/src/index.js index 3938c5c..7ecbbc2 100644 --- a/src/index.js +++ b/src/index.js @@ -91,7 +91,7 @@ export default function parse(md, prevLinks) { // Headings: else if (token[12] || token[14]) { t = 'h' + (token[14] ? token[14].length : (token[13]>'=' ? 1 : 2)); - chunk = '<'+t+'>' + parse(token[12] || token[15], links) + ''; + chunk = '<'+t+' id="'+ parse(token[12] || token[15]).replaceAll(" ","-").toLowerCase() +'">' + parse(token[12] || token[15], links) + ''; } // `code`: else if (token[16]) {