Giter VIP home page Giter VIP logo

Comments (5)

rushter avatar rushter commented on May 29, 2024

Since the parsing engines behind selectolax follow all the standards, they omit the doctype.
Not sure if we can retrieve the original doctype, I need to check. In HTML5, the doctype is the same for all websites.

You can test it in Chrome/Firefox devtools: document.documentElement.outerHTML returns no doctype.

from selectolax.

vidhu avatar vidhu commented on May 29, 2024

@rushter Thanks for your response. What do you mean by "follow all the standards"? Unless theres a standards which states that the doctype is not part of the document (very unlikely) I think it should be included. This would also be inline with what other parsers do

A doctype is not part of the documentElement, it's part of the document. You can verify this in devtools document.doctype

Doctype is indeed same for all html5 websites but not for all websites. My use case requires me to make edits to a given html so I need to maintain the doctype.

Feel free to close this issue if you feel its better to file this in the Modest parsing engine project

from selectolax.

rushter avatar rushter commented on May 29, 2024

I will add doctype, but most likely, only next week.

from selectolax.

rushter avatar rushter commented on May 29, 2024

I made a simple fix, please test it.

from selectolax.

vidhu avatar vidhu commented on May 29, 2024

I'll test it within 24hr and report back. Thank you!

from selectolax.

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.