Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

small code example and typo fixes #36

merged 10 commits into from Dec 18, 2012


None yet
3 participants

thisconnect commented Dec 14, 2012

please cherry-pick whatever you like

@spikebrehm spikebrehm and 1 other commented on an outdated diff Dec 14, 2012

@@ -1182,7 +1182,7 @@
var previousFancyInput = global.FancyInput;
function FancyInput(options) {
- options || (options = {});
+ return options || (options = {});

spikebrehm Dec 14, 2012


Careful, if you return options, then this function constructor won't work as expected! Although maybe something like this is more useful:

this.options = options || {};

hshoff commented Dec 14, 2012

Thanks for the PR @thisconnect! Looks like some really nice cleanup.

Before I merge this in, why double quotes for the markup?


thisconnect commented Dec 14, 2012

Personally I always use single quotes for JavaScript and double quotes for markup and CSS. This in cases where you have to write markup or style in JavaScript

var element = document.getElementsByTagName('div')[0];

// bad
element.innerHTML = '<a href=\'#\'>link</a>';
element.style.backgroundImage = 'url(\'http://jsfiddle.net/img/logo.png\')';​

// good
element.innerHTML = '<a href="#">link</a>';
element.style.backgroundImage = 'url("http://jsfiddle.net/img/logo.png")';​

or the other way around

<!-- bad -->
<a href='#' onclick='document.write(\'<h1>dont use document.write</h1>\');'>

<!-- good -->
<a href="#" onclick="document.write('nor mix style or behavior with markup');">

But the it doesn't matter for html in markdown. Please just git cherry-pick the commits you like.

See also http://google-styleguide.googlecode.com/svn/trunk/htmlcssguide.xml#HTML_quotation_marks but then the google html/css styleguide also proposes using single quotes for CSS which I don't prefer, since they are clearly wrong :P .


thisconnect commented Dec 15, 2012

@h4rry do you want me to try to revert that double quotes commit, so you can just pull?


hshoff commented Dec 18, 2012

@thisconnect yes please! that'd be much appreciated 🍻


thisconnect commented Dec 18, 2012

Reverted a2fd260 but got a little merge conflict with Compatability -> Compatibility. Should be good now.


hshoff commented Dec 18, 2012

Looks great! Thanks!

@hshoff hshoff added a commit that referenced this pull request Dec 18, 2012

@hshoff hshoff Merge pull request #36 from thisconnect/master
small code example and typo fixes

@hshoff hshoff merged commit 2091d96 into airbnb:master Dec 18, 2012

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