Comments (3)
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?
from grunt-dom-munger.
The problem I'm having is that I'm appending some elements to an XML file,
and unfortunately some other elements are ending up malformed.
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
another problem with Cheerio (which the xmlMode doesn't help with) -- for
another element, I start out with:
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
tags incorrectly -- I've yet to find the time to hunt it down but will do
so in the next day or two.
Jason
On Tue, Aug 20, 2013 at 2:45 AM, Chris Gross [email protected]:
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?—
Reply to this email directly or view it on GitHubhttps://github.com//issues/4#issuecomment-22877065
.
from grunt-dom-munger.
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:
var updatedContents = (options.xmlMode) ?
would suffice …
from grunt-dom-munger.
Related Issues (20)
- Write to file the return of a callback? HOT 1
- Resolving relative paths HOT 2
- Additional Options HOT 1
- Any thoughts on reordering the options so that remove/update is performed last? HOT 2
- callback not exposing jquery object's full methods HOT 4
- && broken HOT 1
- src option isn't detected HOT 3
- Multiple runs of dom-munger can fail
- File changed/formatted after only reading attributes HOT 1
- Any plans for having this plugin for gulpjs? HOT 1
- Html elements replaced automatically
- Array src - writeto variable overwritten
- Close tags for link, meta tags
- Does dom munger have a gulp version HOT 1
- Escape rails tags
- Mistake in Full End-to-End Example for Concatentation and Minification
- options.read() get only needed ones HOT 1
- adding attributes to commented element
- Node v6.9.2 error but works on earlier versions HOT 4
- Allow short or --verbose output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-dom-munger.