Skip to content

Quotes vs double quotes in data-slider-ticks-labels #645

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

Open
barseghyanartur opened this issue Oct 31, 2016 · 14 comments
Open

Quotes vs double quotes in data-slider-ticks-labels #645

barseghyanartur opened this issue Oct 31, 2016 · 14 comments

Comments

@barseghyanartur
Copy link

barseghyanartur commented Oct 31, 2016

It's very simple.

When data-slider-ticks-labels are given as follows, it works:

data-slider-ticks-labels='["short", "medium", "long"]'

And this does NOT work (no labels are shown):

data-slider-ticks-labels="['short', 'medium', 'long']"

See JSFiddle.

So, when single quotes are used, it doesn't work.

The following also not (no labels):

data-slider-ticks-labels="[\"short\", \"medium\", \"long\"]"
@seiyria
Copy link
Owner

seiyria commented Oct 31, 2016

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 seiyria closed this as completed Oct 31, 2016
@barseghyanartur
Copy link
Author

@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.

@seiyria
Copy link
Owner

seiyria commented Nov 1, 2016

I'm interested in your fix (mostly curiosity), but I still disagree with the premise.

@barseghyanartur
Copy link
Author

Don't you agree, that making a product more developer-friendly is making a better product?

@seiyria
Copy link
Owner

seiyria commented Nov 1, 2016

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.

@barseghyanartur
Copy link
Author

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.

@rovolution
Copy link
Collaborator

rovolution commented Nov 1, 2016

@barseghyanartur feel free to make a PR! We would definitely appreciate it

@rovolution rovolution reopened this Nov 1, 2016
@rovolution
Copy link
Collaborator

@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

@seiyria
Copy link
Owner

seiyria commented Nov 1, 2016

@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.

@rovolution
Copy link
Collaborator

rovolution commented Nov 1, 2016

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.

@reggieriser
Copy link

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.

@barseghyanartur
Copy link
Author

@reggieriser:

A workaround example.

@rovolution
Copy link
Collaborator

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!

@mayankvara
Copy link

when does it get marged i am also facing issue with quote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants