Code Monkey home page Code Monkey logo

Comments (3)

stephancasas avatar stephancasas commented on May 27, 2024 1

Hello, again!

It looks like cheerio attempts to standardize content between <select> tags by dropping everything other than <option> elements. To override this behavior, I've added select to the list of unsafe tags maintained by Presto.

Please update your project's version of Presto to v1.0.33 and attempt running your tests again.

As I push further toward getting Presto's source staged for examination and pull requests, moving away from cheerio as a dependency is something under heavy consideration. Knowing that this is going to eventually occur has been a key reason that Presto is presently only available as a preview in its dist state.

Please let me know what your findings are when you've had a chance to test.

Thanks!

from presto.

LaundroMat avatar LaundroMat commented on May 27, 2024 1

Thanks for the quick fix! It works now, also in my code (and not only in the barebones I posted).
Keep up the good work!

from presto.

stephancasas avatar stephancasas commented on May 27, 2024

Howdy! Thank you for your kind words and for raising this issue.

I am able to replicate the output you've described, and this is definitely not intended behavior. Presto uses cheeriojs as a bundled dependency to handle DOM manipulations, which has a habit of dropping <template> tags when it ingests HTML. While I'm sure the developers of cheerio had very good reasons for doing this, it definitely works against Presto's workflow.

To counteract this, Presto maintains a list of "unsafe" tags, and uses a series of regex sequences to escape occurrences into non-standard tags that are reverted just before writing to disk — <template> is definitely on this list. It does seem, however, that escaping did not occur as expected, so I'll investigate this tonight and push a bugfix asap.

Thank you again!

from presto.

Related Issues (4)

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.