Fix other lists getting listed

This commit is contained in:
Sam Carlton 2020-11-20 12:37:43 -06:00
parent 30124c1ad4
commit 7ceabf3a42
2 changed files with 19 additions and 5 deletions

View file

@ -62,13 +62,24 @@ export default async function () {
// Parse markdown
const result = md.parse(readmeContent)
// .map(token => {
// })
// console.log('results', result.length)
// console.log('results', result)
// Finf the end of our list
const endOfListIndex = result.findIndex((Token) => {
// JSON.stringify(Token).includes('end-of-list')
const matches = Token.content.includes('end-of-list')
if (matches) {
console.log('Token', Token)
}
return matches
})
const appListTokens = result.slice(0, endOfListIndex)
const appList = []
let sectionSlug = 'start'
@ -76,7 +87,7 @@ export default async function () {
let isHeading = false
let isParagraph = false
for (const token of result) {
for (const token of appListTokens) {
// On heading close switch off heading mode
if (token.type.includes('heading_')) isHeading = !isHeading