html2idom

WebJar for html2idom

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

html2idom
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

html2idom
WebJar for html2idom
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/ericponto/html2IDOM

Download html2idom

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/html2idom/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>html2idom</artifactId>
    <version>0.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/html2idom/
implementation 'org.webjars.npm:html2idom:0.0.5'
// https://jarcasting.com/artifacts/org.webjars.npm/html2idom/
implementation ("org.webjars.npm:html2idom:0.0.5")
'org.webjars.npm:html2idom:jar:0.0.5'
<dependency org="org.webjars.npm" name="html2idom" rev="0.0.5">
  <artifact name="html2idom" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='html2idom', version='0.0.5')
)
libraryDependencies += "org.webjars.npm" % "html2idom" % "0.0.5"
[org.webjars.npm/html2idom "0.0.5"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm » html-parse-stringify jar [1.0.2,2)
org.webjars.npm : htmlparser2 jar [3.8.3,4)
org.webjars.npm : incremental-dom jar [0.1.0,0.2)

Project Modules

There are no modules declared in this project.

html2idom

Convert a string of HTML into an Incremental DOM render.

HTML parsing done by htmlparser2, which is a very fast and accurate HTML parser. However, it comes at a cost up front as it adds around 40kb (min and gzipped) to your code.

If that dependency is too large,then there is a light version (require("html2idom/light")) using html-parse-stringy, which is much smaller in size, but slower when parsing HTML. If you are only dealing with small sets of HTML, then this option might be better.

Installation

npm install html2idom

Usage

var patchHTML = require("html2idom").patchHTML;

// get you view's el
var el = document.getElementById("view");
var html = "<h1 class='greetings'>Hello, World</h1>";

// apply the HTML to the el via incremental dom
patchHTML(el, HTML);

Versions

Version
0.0.5