Code Monkey home page Code Monkey logo

Comments (7)

cgrand avatar cgrand commented on August 26, 2024

Can you provide an example where the behaviour of Enlive change depending on the doctype case? Thanks

from enlive.

hogepodge avatar hogepodge commented on August 26, 2024

A little bit of clojure code for testing.

(use 'net.cgrand.enlive-html)

(deftemplate doctype-demo-template "simple.html"
    [message]
    [:h1] (content (str message))
)

(deftemplate doctype-demo-template2 "simple2.html"
    [message]
    [:h1] (content (str message))
)

(println (doctype-demo-template "Hello, world!"))
(println (doctype-demo-template2 "Hello, world!"))

The first file, simple.html

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Test</title>
    </head>
    <body>
        <h1>Title</h1>
    </body>
</html>

The second file, simple2.html

<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Test</title>
    </head>
    <body>
        <h1>Title</h1>
    </body>
</html>

The results of the two outputs will differ slightly. The first will produce the document with a doctype, the second without.

(<!DOCTYPE html>
 <html> 
     <head>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <title>Test</title>
    </head> 
     <body> 
         <h1> Hello, world! </h1> 
     </body> 

 </html>)
(<html> 
     <head>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <title>Test</title>
    </head> 
     <body> 
         <h1> Hello, world! </h1> 
     </body> 

 </html>)

from enlive.

cgrand avatar cgrand commented on August 26, 2024

You're right. I need to look into Tagsoup source since it's Tagsoup which doesn't recognize a lowercased DOCTYPE.
(when you submitted the bug I tried various lettercasing of "html", not of "doctype")

from enlive.

jplaza avatar jplaza commented on August 26, 2024

@cgrand any progress on this issue?

from enlive.

ifesdjeen avatar ifesdjeen commented on August 26, 2024

Good news, everyone: there's an update on TagSoup: http://ccil.org/~cowan/XML/tagsoup/

That could resolve that issue (DOCTYPE is now recognized even in lower case). I'll fire the PR later today. But it feels that even test suite passes it's better to keep that update in a branch.

from enlive.

ifesdjeen avatar ifesdjeen commented on August 26, 2024

And it's fixed.
@hogepodge could you please close?

from enlive.

hogepodge avatar hogepodge commented on August 26, 2024

Happy to do it.

from enlive.

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.