const tokens: TokensList = processor.lexer(input)
return tokens
.filter((t) => t.type !== 'space')
.map((t) => {
if (t.type === 'code') {
return { type: 'code', content: t.text, lang: t.lang }
} else {
const html = processor.parse(t.raw)
return { type: 'html', content: html }
}
})
const tokens: TokensList = processor.lexer(input)
return tokens
.filter((t) => t.type !== 'space')
.map((t) => {
if (t.type === 'code') {
return { type: 'code', content: t.text, lang: t.lang }
} else {
const html = processor.parse(t.raw)
return { type: 'html', content: html }
}
})