simple-inline
👔 Generate inline elements from plain text using
begin
&offset
Usage
const inline = ; const text = 'hello world';const styles = begin: 0 offset: 5 types: 'underline' begin: 6 offset: 5 types: 'bold' 'strike' begin: 4 offset: 3 types: 'italic'; // generate htmlconst result = ;
Output
hello world
Install
$ npm i simple-inline
API
inline(text, styles[, options])
const inline = ;
text
type: string
styles
type: object
(array)
An item must have begin
, offset
and types
.
types
is string array and will be <span class="<types>"...
options
returnType
specify return type. html
(default) or object
.
const result = ;
Test
$ npm test
License
MIT © Jaewe Heo