Git Product home page Git Product logo

Comments (6)

Gregg8 avatar Gregg8 commented on June 28, 2024

Yes, you are certainly correct about both of those attributes. I will not be able to get an opportunity to work on this for a while. If you end up making the changes yourself, we'd be happy to incorporate your code.

from re-com.

meowcakes avatar meowcakes commented on June 28, 2024

Hi, I began working on a pull request and while doing so I ran into the problem of validating XML attribute names. According to the W3 spec here http://www.w3.org/TR/2011/WD-html5-20110525/elements.html#embedding-custom-non-visible-data-with-the-data-attributes the data-* attribute has to be a valid XML attribute name (not surprising, I guess). I tried implementing the naming spec here http://www.w3.org/TR/REC-xml/#NT-Name using a regular expression, but then found it was exceptionally painful due to JavaScript's poor support for Unicode characters in regular expressions. I could implement it without using a regular expression, but I thought it might be a good idea to ask whether you think it's even worth it to do so, or is it good enough to just make sure the the attribute starts with data- and has one or more characters after that?

Thanks, and apologies for the bikeshedding

from re-com.

mike-thompson-day8 avatar mike-thompson-day8 commented on June 28, 2024

The goal with this validation is to help a programmer catch problems early. Misspelling something can take a surprisingly long time to find sometimes.

So we want to be as helpful as we can be, but not tie ourselves in knots doing it ;-)

In which case, I think checking for data-* and waving it through as vailid is fine by me.

from re-com.

mike-thompson-day8 avatar mike-thompson-day8 commented on June 28, 2024

@meowcakes checking: given you have closed this, are you then working on a patch to wave data-* through as valid?

from re-com.

meowcakes avatar meowcakes commented on June 28, 2024

Yup, pull request opened here #13

from re-com.

mike-thompson-day8 avatar mike-thompson-day8 commented on June 28, 2024

Thanks!

from re-com.

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.