Coder Social home page Coder Social logo

Comments (8)

snoyberg avatar snoyberg commented on June 24, 2024

Just to confirm: this is applying to Hamlet, not Lucius or Cassius, correct?

from shakespeare.

pacak avatar pacak commented on June 24, 2024

Yes. I actually didn't tried replicating this in Lucius/Cassius, so it's just Hamlet.

from shakespeare.

snoyberg avatar snoyberg commented on June 24, 2024

The fact is that the spaces are not intended to be optional between the class and ident tokens, as we start to run into syntax ambiguities (the hash is overloaded for "insert a variable" and "start an identifier"). So I'd actually be tempted to say that both of those are invalid Hamlet and should raise a warning. But I'm not sure how others would feel about such a change.

from shakespeare.

pacak avatar pacak commented on June 24, 2024

h1.foo#bar and h1#bar.foo looks pretty unambiguous to me and converting that into invalid hamlet sounds like a bad idea.

from shakespeare.

gregwebs avatar gregwebs commented on June 24, 2024

I don't see where there would be ambiguity. I think both should be supported. An id is more important than a class and I think should go first as a best practice, but I don't think Hamlet should enforce that.

from shakespeare.

snoyberg avatar snoyberg commented on June 24, 2024

The ambiguity comes from:

h1.foo#{bar}

We could do more checking: if a hash is followed by a left brace, then it's not an ID. But that's the reason I'm in favor of just making all of the spaces a requirement.

from shakespeare.

gregwebs avatar gregwebs commented on June 24, 2024

I constantly use h1#id.class
I never use .class#id, and am ok with saying that it isn't supported.

It is bad to currently pass # through as an invalid class name character though.

from shakespeare.

snoyberg avatar snoyberg commented on June 24, 2024

Agreed on that last point, I've added an error explaining the problem.

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.