-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doesn't recognize identifiers with slashes #62
Comments
Thanks for the report :) |
@cpetzold - the 1a8445f fix you put in on Monday, changing I'm getting stack traces like:
Aliasing (def string-or-keyword name) On my local install, and it works, ... why the change? |
@rm-hull I can't speak to the stack trace issue, but as for "why the change?" see this ticket. |
Hmmm... Well this solves it, I suppose: (defn string-or-keyword [s]
(if (keyword? s)
(-> (str s) (subs 1))
(str s))) by wrapping the s when it's not a keyword (it is a symbol, after all); I guess it should be called |
@rm-hull I think that would work. It's a shame this isn't standardized in core somewhere to be idiomatic. |
Quick update on this: I didn't really fully consider the consequence of the exception message: Hunting through the code there was a single snippet as follows:
i.e. it was missing the starting colon, and was being treated as a symbol - this had worked previously when the code was using Clearly my code was wrong, but is it worth fixing this up as per my previous comment? Happy to raise a PR for it. |
Ah funny, didn't realize the template macros worked with symbol tags. I think it's a bit dangerous for this to work, because switching from the macro to run-time template fns would break in this case. Maybe an assertion that verifies that the tag is a keyword? I'm unsure about allowing string tags, as we may want to treat string vectors as text node groupings instead. |
id's or classes that have a
/
character aren't processed. (This is usually caused in clojure by accidentally usingname
as a generic keyword-to-string function.)Note this is a legal character in html5: http://www.w3.org/html/wg/drafts/html/master/dom.html#the-id-attribute
I'm assuming not all characters can easily be supported, but perhaps this is an easy fix.
A solution would be something a function like
(subs (str :abc) 1)
, but there may be something better.The text was updated successfully, but these errors were encountered: