Open barseghyanartur opened 7 years ago
It's possible that it's because it does JSON parsing.
As such, there's not anything we can do to fix this (besides do some things that I don't think we should do). If you want different control, please do it via JS instead of HTML.
@seiyria:
Let me disagree with you. Most of the freameworks use double quotes for HTML attributes:
data-slider-ticks-labels="['short', 'medium', 'long']"
Fix is trivial. I can submit a pull request. Let me know, please.
I'm interested in your fix (mostly curiosity), but I still disagree with the premise.
Don't you agree, that making a product more developer-friendly is making a better product?
I believe there's a middleground that is a tradeoff in developer-friendliness and maintainability, which comes from simple solutions to problems and good documentation (which I believe we have achieved with the current implementation + documentation). I'm not willing to debate my philosophy further on a random thread on github, because it never really goes well.
Single quotes are uncommon. Bootstrap3 itself uses double quotes. Foundation5 uses double quotes. The right choice is obvious.
FYI:
Use double ("") rather than single quotation marks ('') around attribute values.
Double quotes around attribute values are the most common in HTML, but single quotes can also be used.
Nice project, though. MIT = do what you want. Thanks for that.
@barseghyanartur feel free to make a PR! We would definitely appreciate it
@seiyria he cited some pretty credible sources to validate his point, so I think we should definitely be willing to accept a PR for this
@rovolution I said I'd be interested in looking at his fix (all of the ones I have in mind, I also have loopholes in mind for why they're bad), but instead he chose to bikeshed at me in the way that he did, which doesn't really sit well with me.
That aside, I don't find w3schools to be particularly credible (it has been getting better) and google has always been a proponent of doing their own thing (dart, traceur, closure, etc) so of course they have opinions.
Personally, I prefer double quotes for attributes too. However, given that I have no idea what his proposed solution is (which I did say I was interested in), I am still siding with what I said above.
understood. I just saw the part where he offered to make a PR, and as long as it adheres to our guidelines, I'm cool.
Just ran into this issue as well. Part of my confusion came from the fact that I was referencing Example 14 from the API examples page, which shows the (non-working) double quotes with embedded single quotes. That should probably be changed until this is fixed.
BTW, I'm using a framework (Django) to output these custom attributes on a text widget. Django renders attribute values in double quotes, so it's not trivial for me to just flip the double-quotes to single quotes.
@reggieriser:
That should probably be changed until this is fixed.
I will go ahead and update the example to reflect the correct version until there is a fix for this. thanks!
when does it get marged i am also facing issue with quote.
It's very simple.
When data-slider-ticks-labels are given as follows, it works:
And this does NOT work (no labels are shown):
See JSFiddle.
So, when single quotes are used, it doesn't work.
The following also not (no labels):