Skip to content

Commit e03329f

Browse files
committed
feat: add silent flag
1 parent 046d847 commit e03329f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/parse.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
parseList
1515
} from './parsers/index.js'
1616

17-
export default async function parseMD(body) {
17+
export default async function parseMD(body, {silent = false}) {
1818
const tokens = await unified().use(remarkParse).use(remarkGfm).parse(body)
1919
if (!tokens) {
2020
return []
@@ -76,8 +76,10 @@ export default async function parseMD(body) {
7676
const obj = structuredResponse[currentHeading]
7777
obj.content.push(token.children[0].value)
7878
} else {
79-
console.log('unhandled token type')
80-
console.log(token)
79+
if(!silent){
80+
console.log('unhandled token type')
81+
console.log(token)
82+
}
8183
}
8284
}
8385

0 commit comments

Comments
 (0)