Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

A JavaScript library to create DOM trees from HTML strings.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 src
Octocat-spinner-32 tst
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Makefile
Octocat-spinner-32 README.md
README.md

Arbutus

A JavaScript library to create DOM trees from HTML strings.

Examples

arbutus.parseHTML returns a DocumentFragment.

var fragment = arbutus.parseHTML('<div>alpha</div>');
fragment.firstChild.tagName; // 'DIV'
var fragment = arbutus.parseHTML('  abc<span>beta</span>');
fragment.firstChild.nodeValue; // 'abc'
fragment.firstChild.nextSibling.tagName; // 'SPAN'

Downloads

See http://peter.michaux.ca/downloads/arbutus/ for production ready builds.

Status

Stable.

Browser Support

Tested working in IE6 and newer browsers by a variety of manufacturers.

Dependencies

None.

Source Code

GitHub: https://github.com/petermichaux/arbutus

Build

To build the production ready files, you need JSMin or any other tool with the same command line interface. Then just type "make" at the command line and look in the build directory for the results.

For the record, this is how I installed JSMin. Note that I have /Users/peter/bin in my PATH.

$ cd ~/tmp
$ curl -O https://raw.github.com/douglascrockford/JSMin/master/jsmin.c
$ gcc -o jsmin jsmin.c
$ mv jsmin ~/bin
$ rm jsmin.c
$ which jsmin
/Users/peter/bin/jsmin

Tests

To run the automated tests, open tst/runner.html in a web browser.

Author

Peter Michaux
petermichaux@gmail.com
http://peter.michaux.ca/
@petermichaux

License

Simplified BSD License. See the included LICENSE file for details.

Something went wrong with that request. Please try again.