Coder Social home page Coder Social logo

hamlet allows slash in tag names about shakespeare HOT 7 CLOSED

sol avatar sol commented on July 23, 2024
hamlet allows slash in tag names

from shakespeare.

Comments (7)

snoyberg avatar snoyberg commented on July 23, 2024

Good idea, patch applied.

from shakespeare.

sol avatar sol commented on July 23, 2024

@snoyberg I guess I could construct other cases that produce undesirable results. I think the only sensible way to handle this is to follow the specs. I have a patch for this, that I'll push soon.

from shakespeare.

snoyberg avatar snoyberg commented on July 23, 2024

You mean like having sensible values for attribute names and such? I've taken the approach for the most part of "not our problem," but we may as well ensure validity at compile time since it's so easy. If you come up with any other cheap fixes, definitely send a pull request.

from shakespeare.

sol avatar sol commented on July 23, 2024

@snoyberg It is a little bit more code, this is why I put it into a separate module. The layout and comments mean to make it easy to compare it with the spec. I do not use elem because this is an order of magnitude slower than expanding it.

from shakespeare.

snoyberg avatar snoyberg commented on July 23, 2024

I think what you've put in is too restricting. For example, some Javascript libraries out there use colons in tag names. Also, you could embed SVG in such a way.

I'm not sure what you mean by elem being an order of magnitude slower. It's going to cause the string to be traversed twice: once in the parse, and then afterwards in the check. The reason I did it with the elem was to give better error messages, and to keep the parser more consistent.

from shakespeare.

sol avatar sol commented on July 23, 2024

@snoyberg Oh, that is unfortunate. I would still love to have better compile-time guarantees for well-formed content, but right now I've no idea how to tackle it.

Regarding elem: I had a situation where it made code 10x faster; I could imagine, that the main difference came from inlining. But better error messages are probably more important.

from shakespeare.

snoyberg avatar snoyberg commented on July 23, 2024

Another performance issue to point out is that this only affects compile time, not runtime. We all hate long compiles, but I doubt this is the bottleneck.

from shakespeare.

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.