GithubHelp home page GithubHelp logo

*escape-strings?* about hiccup HOT 1 CLOSED

simon-brooke avatar simon-brooke commented on June 30, 2024
*escape-strings?*

from hiccup.

Comments (1)

weavejester avatar weavejester commented on June 30, 2024

In the current master version (1.0.5) of hiccup.util, a dynamic variable *escape-strings?* is declared. However, it doesn't appear to be present in the 1.0.5 jar file as downloaded from clojars.org.

The *escape-strings?* variable was introduced in 2.0.0-alpha1. The master branch is tracking 2.0.0, not 1.0.5.

There is a function hiccup.compiler/escape-html which reads this variable, and, if it is bound to true (as by default it is), calls a function hiccup.util/escape-html on its argument.

I'm currently having a problem with hiccup rendering single quote characters within JavaScript strings as &apos

Why is that a problem?

So, my questions:

1. is it an oversight that `hiccup.util/*escape-strings?*` is missing from the 1.0.5 jar on clojars.org?

No, because that variable was added laater.

2. if so, would a patch to allow a new 1.0.6 version with the variable present to be compiled be accepted?

No, because that variable ties into the 2.0.0 changes around raw strings.

3. if not, is it the intention that the `:escape-strings?` option key in 2.0.0, given the value `false`, should disable `'` substitution?

I believe that attributes are always escaped, as I don't know of any reason not to.

4. if so, would a patch to allow a new 2.0.0-alpha3 version with the options key `:escape-strings?` working to be compiled be accepted?

Working for attributes you mean? You'd need to provide a reason for allowing unescaped attribute values.

from hiccup.

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.