-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adhere to Cheerio's XML mode when xmlMode option is specified #4
Comments
I'm trying to understand the use-case you're hitting. I don't mind making the addition but I was under the assumption that cheerio would endeavor to write the document back out with the same tags as before (plus whatever your modifications were). Is it not doing this or is there some similar kind of issue? |
The problem I'm having is that I'm appending some elements to an XML file, In particular I start out with: and, without this change, end up with: (note the lack of the self closing /). Actually, although this suggested change fixes this problem, I strike 2012-08-20T03:18:06Z and end up with: 2012-08-20T03:18:06Z (i.e. it drops the entire closing tag). There looks to be something buried in cheerio that specifically treats meta Jason On Tue, Aug 20, 2013 at 2:45 AM, Chris Gross [email protected]:
|
Could we get this fixed? If cheerio would just write back the document unchanged, that would not be a problem, but it is removing all slashes from self closing elements (if you use $.html). That will break XHTML and polyglot documents. A one liner like: |
Cheerio exposes an option "xmlMode: true", which should be used to distinguish between writing out HTML ($.html() ) and XML ( $ .xml() ).
Therefore, in method processFile:
Should become:
The text was updated successfully, but these errors were encountered: