0.1.2 • Published 7 years ago

lofi v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Lofi · JavaScript

Travis npm package Coveralls

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
parseElement('Click me #button #primary')
/* => {
  texts: ['Click me'],
  mentions: [null],
  tags: { button: true, primary: true },
  children: []
} */

parseElement('Hello @first-name, how are you?')
/* => {
  texts: ['Hello ', ', how are you?'],
  mentions: [['first-name'], null],
  tags: {},
  children: []
} */
0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago