|
@@ -201,10 +201,11 @@ module.exports = {
|
|
|
|
|
|
let headers = []
|
|
|
$('h1,h2,h3,h4,h5,h6').each((i, elm) => {
|
|
|
+ let headerSlug = uslug($(elm).text())
|
|
|
+ // -> If custom ID is defined, try to use that instead
|
|
|
if ($(elm).attr('id')) {
|
|
|
- return
|
|
|
+ headerSlug = $(elm).attr('id')
|
|
|
}
|
|
|
- let headerSlug = uslug($(elm).text())
|
|
|
|
|
|
// -> Cannot start with a number (CSS selector limitation)
|
|
|
if (headerSlug.match(/^\d/)) {
|