Load html
Load JSON-LD from HTML documents.
- Adds options parameter to documentLoader
- Uses xmldom, if loaded.
- Adds util.ParseContentTypeHeader
- Adds documentLoader implementations for xhr and node (still requires tests).
- Set default for expandAllScripts to true for flatten and toRdf.
Some tests still required for XHR and Node documentLoaders.
Some work needed to optionally append text/html (and application/xhtml+xml) to accept headers if we can parser HTML.
Perhaps some abstracted parsing support to handle other HTML parsers?
Otherwise, please see if you agree with the general direction of this work.
Perhaps the webpack build is failing because it doesn't include xmldom? Should there be a way to condition tests on this? How?
Thanks @gkellogg! This is great. A few minor changes needed plus one architectural thing we need some feedback from @davidlehn on (regarding how to pull in a dom parser).
@davidlehn are we waiting for something else to merge this?
@gkellogg I was waiting on me to look into how to improve the way the xmldom lib is used. Otherwise I think patch is good. As Dave's comment mentioned, might want some sort of registered parser pattern. Need to check how the current code works with bundlers and such.