Skip to content

Instantly share code, notes, and snippets.

@DanGe42
Last active August 7, 2019 21:09
Show Gist options
  • Save DanGe42/c854660630c8d6a1ddcb7d0ac01294cb to your computer and use it in GitHub Desktop.
Save DanGe42/c854660630c8d6a1ddcb7d0ac01294cb to your computer and use it in GitHub Desktop.
A trailing whitespace riddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.external-link--inline-block {
display: inline-block;
}
.external-link--flush {
margin-right: -4px;
}
<h1>Welcome to {{appName}}</h1>
<h2>Angle brackets</h2>
<p>This is an
<ExternalLink
@href="https://www.example.com"
@newTab={{true}}
>
example link that opens a new tab
</ExternalLink>.
</p>
<p>This is an
<ExternalLink
@class="external-link--inline-block"
@href="https://www.example.com"
@newTab={{true}}
>
inlined external link
</ExternalLink>.
</p>
<p>This is
<ExternalLink
@class="external-link--inline-block external-link--flush"
@href="https://www.example.com"
@newTab={{true}}
>
straight flush
</ExternalLink>.
</p>
<p>All on <ExternalLink @href="https://www.example.com" @newTab={{true}}>one line</ExternalLink>.</p>
<h2>Curly braces</h2>
<p>This is an
{{#external-link
href="https://www.example.com"
newTab=true
}}example link that opens a new tab{{~/external-link~}}.
</p>
<p>This is an
{{#external-link
class="external-link--inline-block"
href="https://www.example.com"
newTab=true
}}
inlined external link
{{/external-link}}.
</p>
<p>All on {{#external-link href="https://www.example.com" newTab=true}}one line{{/external-link}}.</p>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment