jsonld.js icon indicating copy to clipboard operation
jsonld.js copied to clipboard

Load html

Open gkellogg opened this issue 6 years ago • 5 comments

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.

gkellogg avatar Dec 28 '19 01:12 gkellogg

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.

gkellogg avatar Dec 28 '19 01:12 gkellogg

Perhaps the webpack build is failing because it doesn't include xmldom? Should there be a way to condition tests on this? How?

gkellogg avatar Dec 28 '19 20:12 gkellogg

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).

dlongley avatar Jan 06 '20 15:01 dlongley

@davidlehn are we waiting for something else to merge this?

gkellogg avatar Mar 03 '20 00:03 gkellogg

@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.

davidlehn avatar Mar 03 '20 02:03 davidlehn