Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

yields/parse-attrs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-attrs

attributes parser.

Installation

$ component install yields/parse-attrs

Example

assert('baz' == parse('foo="baz"').foo);
assert('baz' == parse("foo='baz'").foo);
assert('baz' == parse('foo=baz').foo);
assert('' == parse('foo').foo);
var attrs = parse('foo bar baz');
assert('' == attrs.foo);
assert('' == attrs.bar);
assert('' == attrs.baz);
var attrs = parse('foo=bar baz="foo bar" bar=\'baz\'');
assert('bar' == attrs.foo);
assert('baz' == attrs.bar);
assert('foo bar' == attrs.baz);

License

MIT

About

html attribute parser.

Resources

Stars

Watchers

Forks

Packages

No packages published