Simple usage
First just import the MarkdownParser
class parser and instantiate the class
import { MarkdownParser } from '@language-kit/markdown'
const parser = new MarkdownParser()
Then you can the method toNodes()
to convert a plain text to nodes
const nodes = parser.toNodes("Hello dio")
// output
[
{
start: 0,
end: 8,
type: 'paragraph',
tokens: [
{ type: 'Word', value: 'Hello', start: 0, end: 4 },
{ type: 'WhiteSpace', value: ' ', start: 5, end: 5 },
{ type: 'Word', value: 'dio', start: 6, end: 8 },
{ type: 'EndOfFile', value: '', start: -1, end: -1 }
]
}
]