Git Product home page Git Product logo

Comments (4)

kojiishi avatar kojiishi commented on May 5, 2024 1

Thanks for reporting this issue!

I think the parser should gracefully handle unpaired close tags. Let me look into this, similar to how browsers handle such case.

For self-closing tags such as <img>, I think it's supported, but we don't have tests. I'll look into it too.

from budoux.

tushuhei avatar tushuhei commented on May 5, 2024

Thanks for reporting this. The change is due to the non-breaking markup support we introduced at #251, where we need to track the elements in a queue.

Could you elaborate your specific use case that you want to include a close tag with no corresponding open tag? I acknowledge that we need to improve the error message, but BudouX is intended to work with a valid document fragment.

from budoux.

johncarter-phntm avatar johncarter-phntm commented on May 5, 2024

Thanks. It was actually a content bug to have a missing open tag, but I thought worth reporting since it's a change in behaviour.

I don't need this to be a supported case, though maybe a nicer exception would be useful - otherwise happy for you to close as expected behaviour.

from budoux.

tushuhei avatar tushuhei commented on May 5, 2024

Thanks for your input. Raising a better exepction sounds like a plan.
That said, the element queue's emptiness is not enough to detect if the given HTML string is valid or not. The string like below will work with budoux==0.6.0 CLI even thought the string is not a valid HTML.

budoux --html "あの空を見る限り<img>今日はとてもいい天気ですね。</p>"

We may need to check void elements as well to manage the element queue and the document's validity better.
@kojiishi any thoughts on this?

from budoux.

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.