Skip to content

Commit

Permalink
feat: add silent flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioSimou committed Sep 26, 2022
1 parent 046d847 commit e03329f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
parseList
} from './parsers/index.js'

export default async function parseMD(body) {
export default async function parseMD(body, {silent = false}) {
const tokens = await unified().use(remarkParse).use(remarkGfm).parse(body)
if (!tokens) {
return []
Expand Down Expand Up @@ -76,8 +76,10 @@ export default async function parseMD(body) {
const obj = structuredResponse[currentHeading]
obj.content.push(token.children[0].value)
} else {
console.log('unhandled token type')
console.log(token)
if(!silent){
console.log('unhandled token type')
console.log(token)
}
}
}

Expand Down

0 comments on commit e03329f

Please sign in to comment.