Giter Club home page Giter Club logo

Comments (3)

cgross avatar cgross commented on June 30, 2024

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.

jcdarwin avatar jcdarwin commented on June 30, 2024

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.

inta avatar inta commented on June 30, 2024

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) ? $.xml() : $.html();
would suffice …

from grunt-dom-munger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.