Closed philschatz closed 6 years ago
It no longer fails to load non-xhtml fragments, which is good, but there's still a big problem: it'll fail if the source contains XML declaration, because (quoting chrome)
error on line 2 at column 6: XML declaration allowed only at the start of the document
Also, css-plus
will not report this problem and exit with code 0, making it necessary to inspect all output files manually.
While the XML declaration problem is easy to circumvent, #10 unfortunately makes css-plus
still unusable for XML manipulation.
This now fixes most of the cases listed in #10 (except <c>
). I can revisit <c>
if it is a problem in a subsequent Pull Request.
This library can work with arbitrary XML files but since it uses headless chrome those files need to be wrapped in
<html><body>
so chrome uses the XHTML renderer (rather than just rendering the XML tree which isn't really queryable).TODO
isHtml
flag innode.js
all the way intoserializer.js
. In this test output it should only show the<document>
element and its children<html><body>
line at the top) when warnings/errors occur/cc @aiwenar because you are using this to manipulate CNXML and @reedstrm to think about when writing the python port 😄