Skip to content
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

Double Quotes vs Single Quotes #101

Closed
IvanLieckens opened this issue Jan 22, 2015 · 5 comments
Closed

Double Quotes vs Single Quotes #101

IvanLieckens opened this issue Jan 22, 2015 · 5 comments

Comments

@IvanLieckens
Copy link

When using the BeginRenderLink in GlassMapper Sitecore MVC I ran into the issue where I had added an extra attribute onto my link for rendering the GA tracking: new { onclick = "ga('send', 'event', 'category', 'action', 'label');" }

This mangled the HTML output however due to the single quotes being used by the GlassMapper HtmlHelper. All our HTML is using double quotes and our js is using single quotes. I'm aware this is a flavor issue (and I fixed it for now by using double quotes in the attribute) but would it be possible to turn this into an option what quoting you prefer? It'd help my OCD getting all the quotes to match ;-)

@mikeedwards83
Copy link
Owner

Ivan, please see the latest nightly build, you will see that I have added a GlassHtml.QuotationMark as an option:

https://github.com/mikeedwards83/Glass.Mapper/blob/develop/Source/Glass.Mapper.Sc/GlassHtml.cs#L69

@IvanLieckens
Copy link
Author

Thanks for the effort Mike!

@mikeedwards83
Copy link
Owner

No problem, I have written a unit test for it but let me know if you find
any issues.

This is currently only available on the feed from the Glass build server.

On 11 February 2015 at 07:45, IvanLieckens notifications@github.com wrote:

Thanks for the effort Mike!


Reply to this email directly or view it on GitHub
#101 (comment)
.

@mikeedwards83
Copy link
Owner

Released

@Swimburger
Copy link

Is there a specific reason that single quotes are being used? I think double quotes should be the default, but if you want single quotes you can override it.
I understand both double quotes as single quotes are valid, but it seems that double quotes is an unspoken standard and single quotes are only used in specific cases where you want to use double quotes as the value of your attribute.

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

3 participants