From 7ceabf3a42e9f48a7fcd2b56c36b04c2e5a7654c Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Fri, 20 Nov 2020 12:37:43 -0600 Subject: [PATCH] Fix other lists getting listed --- README.md | 3 +++ helpers/build-app-list.js | 21 ++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 787df19..ccde108 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,9 @@ Any comments, suggestions? [Let us know!](https://github.com/ThatGuySam/doesitar * [Zoom](https://zoom.us/download) - ✳️ Yes, runs via Rosetta 2 - [Discussion](https://github.com/ThatGuySam/doesitarm/issues/134) + + + ## More Apple Silicon Lists * [Is Apple silicon ready?](https://isapplesiliconready.com/) - Great list with detailed app status diff --git a/helpers/build-app-list.js b/helpers/build-app-list.js index 0659282..fa97c38 100644 --- a/helpers/build-app-list.js +++ b/helpers/build-app-list.js @@ -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