Lofi · JavaScript
Installation
npm install lofi --save
API Docs
parseElement(input: String)
Element:
- texts: [ String ] · Array of plain text input
- mentions: [ [ String ] ] · Array of key paths
- tags: { String: Boolean | { texts: [ String ] , mentions: [ [ String ] ] } } · Key-value pairs of booleans or strings
- children: [ Element ] · Array of children elements
/* => { texts: ['Click me'], mentions: [null], tags: { button: true, primary: true }, children: []} */ /* => { texts: ['Hello ', ', how are you?'], mentions: [['first-name'], null], tags: {}, children: []} */