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

Add section on Multi-Line Strings #121

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified convert.sh
100644 → 100755
Empty file.
19 changes: 19 additions & 0 deletions features.txt
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,25 @@ Access the raw template string content (backslashes are not interpreted).
5| // no equivalent in ES5


Multi-Line Strings
-----------------

Include Newline characters in a string.

6| var foo=`
6| The Cat
6| Sat
6| On
6| The Mat`;

5| // no equivalent in ES5: Use Concatenation and \n instead:
5| var foo='\n'+
5| 'The Cat\n'+
5| 'Sat\n'
5| 'On\n'
5| 'The Mat';


Extended Literals
=================

Expand Down
28 changes: 28 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@
<a href="#CustomInterpolation">Custom Interpolation</a> <i class="fa fa-arrow-circle-right"></i></li>
<li class="subtitle subtitle_RawStringAccess">
<a href="#RawStringAccess">Raw String Access</a> <i class="fa fa-arrow-circle-right"></i></li>
<li class="subtitle subtitle_MultiLineStrings">
<a href="#MultiLineStrings">Multi-Line Strings</a> <i class="fa fa-arrow-circle-right"></i></li>
</ul>
</li>
<li class="title">Extended Literals
Expand Down Expand Up @@ -630,6 +632,32 @@
<i class="icon fa fa-times-circle"></i>
</div>
</div>
<div id="MultiLineStrings" class="showcase showcase_MultiLineStrings"> <div class="title">Template Literals</div>
<div class="subtitle">Multi-Line Strings</div>
<div class="desc">Include Newline characters in a string.</div>
<div class="js es6">
<div class="title"><b>ECMAScript 6</b> &mdash; syntactic sugar: <span class="style reduced">reduced</span> | <span class="style traditional">traditional</span></div>
<div class="code"><span class="keyword">var</span> foo=<span class="literal">`
The Cat
Sat
On
The Mat`</span><span class="semi">;</span>
</div>
<i class="icon fa fa-circle"></i>
<i class="icon fa fa-check-circle"></i>
</div>
<div class="arrow"><i class="fa fa-caret-up"></i><i class="fa fa-caret-down"></i></div><div class="js es5">
<div class="title"><b>ECMAScript 5</b> &mdash; syntactic sugar: <span class="style reduced">reduced</span> | <span class="style traditional">traditional</span></div>
<div class="code"><span class="comment">// no equivalent <span class="keyword">in</span> ES<span class="literal">5</span>: Use Concatenation and \n instead:</span>
<span class="keyword">var</span> foo=<span class="literal">'\n'</span><span class="punctuation">+</span>
<span class="literal">'The Cat\n'</span><span class="punctuation">+</span>
<span class="literal">'Sat\n'</span>
<span class="literal">'On\n'</span>
<span class="literal">'The Mat'</span><span class="semi">;</span></div>
<i class="icon fa fa-circle"></i>
<i class="icon fa fa-times-circle"></i>
</div>
</div>
<div id="BinaryOctalLiteral" class="showcase showcase_BinaryOctalLiteral"> <div class="title">Extended Literals</div>
<div class="subtitle">Binary & Octal Literal</div>
<div class="desc">Direct support for safe binary and octal literals.</div>
Expand Down
22 changes: 11 additions & 11 deletions lib/mousetrap/mousetrap.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.