Skip to content

albell/parse-sizes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parse-sizes

A non-strict but robust javascript parser for the [HTML5 sizes] (http://www.w3.org/html/wg/drafts/html/master/embedded-content.html#attr-img-sizes) attribute, based on the [WHATWG reference algorithm] (https://html.spec.whatwg.org/multipage/embedded-content.html#parse-a-sizes-attribute). It has an extensive test suite.

The goal of this function is strong test coverage that goes beyond what is possible with a simple Reg Ex, but without the weight of a full CSS parser. Certain invalid edge-case constructs are therefore not handled. Conforms to jQuery JSCS style guidelines. Code is 1.1k compressed, 603 bytes gzipped.

I’m on twitter @tweetywheaty.

About

javascript parser for the html5 sizes attribute

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published