Giter Club home page Giter Club logo

Comments (8)

cgrand avatar cgrand commented on August 21, 2024

Can you provide a small reproducible test? It may be a problem of default encoding.

from enlive.

kendagriff avatar kendagriff commented on August 21, 2024
(require '[net.cgrand.enlive-html :refer :all])
(html-snippet "<html><body><div>&trade;</div></body></html>")

Outputs:

({:tag :html, :attrs nil, :content ({:tag :body, :attrs nil, :content ({:tag :div, :attrs nil, :content ("™")})})})

I'd like :content to be "™". Is that an unreasonable expectation?

from enlive.

cgrand avatar cgrand commented on August 21, 2024

In your output, :contentis ("™"). I assume it's markdown trying to be halpful.
However in a repl here it works fine too:

=> (-> (net.cgrand.enlive-html/html-snippet "<html><body><div>&trade;</div></body></html>")
     first :content first :content first :content
     first (.codePointAt 0))
8482

What are your locale settings?

from enlive.

kendagriff avatar kendagriff commented on August 21, 2024

Sorry, I should have written it as &-t-r-a-d-e-;. Perhaps it's a problem in wkhtmltopdf. The code 8482 gets garbled, while passing text &-t-r-a-d-e-; as text works fine.

By locale, do you mean country? US...

from enlive.

cgrand avatar cgrand commented on August 21, 2024

How does xkhtmltopdf behaves if it gets & # 8 4 8 2 ; instead of & t r a d e ;?

On Mon, Sep 9, 2013 at 5:36 PM, Kendall Buchanan
[email protected]:

Sorry, I should have written it as &-t-r-a-d-e-;. Perhaps it's a problem
in wkhtmltopdf. The code 8482 gets garbled, while passing text
&-t-r-a-d-e-; as text works fine.

By locale, do you mean country? US...


Reply to this email directly or view it on GitHubhttps://github.com//issues/74#issuecomment-24087028
.

On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

from enlive.

kendagriff avatar kendagriff commented on August 21, 2024

Same result: "â„¢".

from enlive.

cgrand avatar cgrand commented on August 21, 2024

Just to be sure: you bypassed enlive and sent this numerci entity straight
to wkhtmltopdf?

On Mon, Sep 9, 2013 at 5:57 PM, Kendall Buchanan
[email protected]:

Same result: "â„¢".


Reply to this email directly or view it on GitHubhttps://github.com//issues/74#issuecomment-24089131
.

On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/

from enlive.

kendagriff avatar kendagriff commented on August 21, 2024

I sure appreciate your help on this. This is how I've been able to make it work:

(defn- html-as-string
   [html]
   (StringEscapeUtils/unescapeXml
     (StringEscapeUtils/escapeHtml4
       (apply str (e/emit* html)))))

It works, it's just requiring two seemingly unnecessary passes at the markup.

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.