-
Element with class
var wrihtml = require('wrihtml'); var html = wrihtml( `div [text-center bg-danger] This is a div` )
<div class="text-center bg-danger">This is a div</div>
-
Element with attributes
var html = wrihtml( `button [class="btn btn-danger" onclick="alert('alert!')"] a button` )
<button class="btn btn-danger" onclick="alert('alert!')">a button</button>
-
with child element
var html = wrihtml( `div/ [col-12 col-md-6] h1 title 1 h2 title 2 /div` )
<div class="col-12 col-md-6"> <h1>title 1</h1> <h2>title 2</h2> </div>
-
with multiple line inner text
var html = wrihtml( `h1/ [text-dark] // first line text in h1, // 2nd line text in h1 /h1`)
-
Ignore line started with '<'
var html = wrihtml( `h1 [text-dark] h1 text <h2>h2 text</h2> h3 h3 text `)
-
Notifications
You must be signed in to change notification settings - Fork 0
tcs211/tohtml
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published