Clean whitespace with EditorConfig.

This commit is contained in:
Daniel Demmel 2015-03-27 17:57:29 +00:00
parent 1c2dbc3829
commit bdd0a17eb5
4 changed files with 287 additions and 259 deletions

28
.editorconfig Normal file
View File

@ -0,0 +1,28 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.{json,JSON-tmLanguage}]
indent_style = space
indent_size = 4
[*.{html,handlebars}]
indent_style = tab
indent_size = 4
[*.tmLanguage]
indent_style = tab
indent_size = 4
[*.sublime-snippet]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false

View File

@ -1,141 +1,141 @@
{
"name": "Handlebars",
"name": "Handlebars",
"repository": {
"html_tags": {
"patterns": [
{
"begin": "(<)([a-zA-Z0-9:-]+)(?=[^>]*></\\2>)",
"begin": "(<)([a-zA-Z0-9:-]+)(?=[^>]*></\\2>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.html"
}
},
"end": "(>(<)/)(\\2)(>)",
},
"end": "(>(<)/)(\\2)(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "meta.scope.between-tag-pair.html"
},
},
"3": {
"name": "entity.name.tag.html"
},
},
"4": {
"name": "punctuation.definition.tag.html"
}
},
"name": "meta.tag.any.html",
},
"name": "meta.tag.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
},
{
"begin": "(<\\?)(xml)",
"begin": "(<\\?)(xml)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.xml.html"
}
},
"end": "(\\?>)",
"name": "meta.tag.preprocessor.xml.html",
},
"end": "(\\?>)",
"name": "meta.tag.preprocessor.xml.html",
"patterns": [
{
"include": "#tag-generic-attribute"
},
},
{
"include": "#string"
}
]
},
},
{
"begin": "<!--",
"begin": "<!--",
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"end": "--\\s*>",
"name": "comment.block.html",
},
"end": "--\\s*>",
"name": "comment.block.html",
"patterns": [
{
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "<!",
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"begin": "(DOCTYPE|doctype)",
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
"begin": "<!",
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"begin": "(DOCTYPE|doctype)",
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.style.html"
},
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.css.embedded.html",
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.css.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
},
{
"begin": "(>)",
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(?=</(?i:style))",
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "source.css"
@ -143,165 +143,165 @@
]
}
]
},
},
{
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)",
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.js.embedded.html",
},
"name": "source.js.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
},
"end": "(</)((?i:script))",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"match": "(//).*?((?=</script)|$\\n?)",
},
"match": "(//).*?((?=</script)|$\\n?)",
"name": "comment.line.double-slash.js"
},
},
{
"begin": "/\\*",
"begin": "/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.js"
}
},
"end": "\\*/|(?=</script)",
},
"end": "\\*/|(?=</script)",
"name": "comment.block.js"
},
},
{
"include": "source.js"
}
]
}
]
},
},
{
"begin": "(</?)((?i:body|head|html)\\b)",
"begin": "(</?)((?i:body|head|html)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.structure.any.html"
}
},
"end": "(>)",
"name": "meta.tag.structure.any.html",
},
"end": "(>)",
"name": "meta.tag.structure.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
},
{
"begin": "(</?)((?i:address|blockquote|dd|div|header|section|footer|aside|nav|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
"begin": "(</?)((?i:address|blockquote|dd|div|header|section|footer|aside|nav|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.block.any.html"
}
},
"end": "(>)",
"name": "meta.tag.block.any.html",
},
"end": "(>)",
"name": "meta.tag.block.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
},
{
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.inline.any.html"
}
},
"end": "((?: ?/)?>)",
"name": "meta.tag.inline.any.html",
},
"end": "((?: ?/)?>)",
"name": "meta.tag.inline.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
},
{
"begin": "(</?)([a-zA-Z0-9:-]+)",
"begin": "(</?)([a-zA-Z0-9:-]+)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.other.html"
}
},
"end": "(>)",
"name": "meta.tag.other.html",
},
"end": "(>)",
"name": "meta.tag.other.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
},
{
"begin": "(</?)([a-zA-Z0-9:-{}]+)",
"begin": "(</?)([a-zA-Z0-9:-{}]+)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.tokenised.html"
}
},
"end": "(>)",
"name": "meta.tag.tokenised.html",
},
"end": "(>)",
"name": "meta.tag.tokenised.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
},
{
"include": "#entities"
},
},
{
"match": "<>",
"match": "<>",
"name": "invalid.illegal.incomplete.html"
},
},
{
"match": "<",
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
]
@ -312,39 +312,39 @@
"captures": {
"1": {
"name": "punctuation.definition.entity.html"
},
},
"3": {
"name": "punctuation.definition.entity.html"
}
},
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
},
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"name": "constant.character.entity.html"
},
},
{
"match": "&",
"match": "&",
"name": "invalid.illegal.bad-ampersand.html"
}
]
},
},
"end_block": {
"begin": "(\\{\\{~?/)([a-zA-Z0-9_\\.-]+)\\s*",
"end": "(~?\\}\\})",
"name": "meta.function.block.end.handlebars",
"name": "meta.function.block.end.handlebars",
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
}
},
},
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
},
"2": {
"name": "support.constant.handlebars"
}
},
},
"patterns": []
},
},
"yfm": {
"patterns": [
{
@ -352,110 +352,110 @@
{
"include": "source.yaml"
}
],
"begin": "(?<!\\s)---\\n$",
"end": "^---\\s",
],
"begin": "(?<!\\s)---\\n$",
"end": "^---\\s",
"name": "markup.raw.yaml.front-matter"
}
]
},
},
"comments": {
"patterns": [
{
"patterns": [
{
"name": "keyword.annotation.handlebars",
"name": "keyword.annotation.handlebars",
"match": "@\\w*"
},
},
{
"include": "#comments"
}
],
"begin": "\\{\\{![^<]",
"end": "\\}\\}",
],
"begin": "\\{\\{![^<]",
"end": "\\}\\}",
"name": "comment.block.handlebars"
},
},
{
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"begin": "<!--",
"end": "-{2,3}\\s*>",
"name": "comment.block.html",
},
"begin": "<!--",
"end": "-{2,3}\\s*>",
"name": "comment.block.html",
"patterns": [
{
"name": "invalid.illegal.bad-comments-or-CDATA.html",
"name": "invalid.illegal.bad-comments-or-CDATA.html",
"match": "--"
}
]
}
]
},
},
"block_comments": {
"patterns": [
{
"patterns": [
{
"name": "keyword.annotation.handlebars",
"name": "keyword.annotation.handlebars",
"match": "@\\w*"
},
},
{
"include": "#comments"
}
],
"begin": "\\{\\{!--",
"end": "--\\}\\}",
],
"begin": "\\{\\{!--",
"end": "--\\}\\}",
"name": "comment.block.handlebars"
},
},
{
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"begin": "<!--",
"end": "-{2,3}\\s*>",
"name": "comment.block.html",
},
"begin": "<!--",
"end": "-{2,3}\\s*>",
"name": "comment.block.html",
"patterns": [
{
"name": "invalid.illegal.bad-comments-or-CDATA.html",
"name": "invalid.illegal.bad-comments-or-CDATA.html",
"match": "--"
}
]
}
]
},
},
"entities": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.entity.html"
},
},
"3": {
"name": "punctuation.definition.entity.html"
}
},
"name": "constant.character.entity.html",
},
"name": "constant.character.entity.html",
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
},
},
{
"name": "invalid.illegal.bad-ampersand.html",
"name": "invalid.illegal.bad-ampersand.html",
"match": "&"
}
]
},
},
"block_helper": {
"begin": "(\\{\\{~?\\#)([-a-zA-Z0-9_\\./]+)\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*",
"end": "(~?\\}\\})",
"name": "meta.function.block.start.handlebars",
"name": "meta.function.block.start.handlebars",
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
}
},
},
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
@ -475,48 +475,48 @@
"6": {
"name": "support.constant.handlebars"
}
},
},
"patterns": [
{
"include": "#string"
}
]
},
},
"string-single-quoted": {
"begin": "'",
"end": "'",
"name": "string.quoted.single.handlebars",
"begin": "'",
"end": "'",
"name": "string.quoted.single.handlebars",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
},
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
},
"patterns": [
{
"include": "#escaped-single-quote"
},
{
"include": "#block_comments"
},
},
{
"include": "#comments"
},
},
{
"include": "#block_helper"
},
},
{
"include": "#end_block"
},
},
{
"include": "#partial_and_var"
}
]
},
},
"string": {
"patterns": [
{
@ -538,15 +538,15 @@
"partial_and_var": {
"begin": "(\\{\\{~?\\{*(>|!<)*)\\s*(@?[-a-zA-Z0-9_\\./]+)*",
"end": "(~?\\}\\}\\}*)",
"name": "meta.function.inline.other.handlebars",
"name": "meta.function.inline.other.handlebars",
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
},
"3": {
"name": "variable.parameter.handlebars"
}
},
},
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
@ -557,48 +557,48 @@
"include": "#string"
}
]
},
},
"string-double-quoted": {
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.handlebars",
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.handlebars",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
},
"patterns": [
{
"include": "#escaped-double-quote"
},
},
{
"include": "#block_comments"
},
},
{
"include": "#comments"
},
},
{
"include": "#block_helper"
},
},
{
"include": "#end_block"
},
},
{
"include": "#partial_and_var"
}
]
},
"inline_script": {
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?:.*(type)=([\"'](?:text/x-handlebars-template|text/x-handlebars|text/template)[\"']))(?![^>]*/>)",
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?:.*(type)=([\"'](?:text/x-handlebars-template|text/x-handlebars|text/template)[\"']))(?![^>]*/>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.script.html"
},
@ -608,45 +608,45 @@
"4": {
"name": "string.quoted.double.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.handlebars.embedded.html",
},
"name": "source.handlebars.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
},
"end": "(</)((?i:script))",
"patterns": [
{
"include": "#block_comments"
},
},
{
"include": "#comments"
},
},
{
"include": "#block_helper"
},
},
{
"include": "#end_block"
},
},
{
"include": "#partial_and_var"
},
},
{
"include": "#html_tags"
},
@ -658,90 +658,90 @@
]
},
"tag_generic_attribute": {
"begin": "\\b([a-zA-Z0-9_-]+)\\b\\s*(=)",
"begin": "\\b([a-zA-Z0-9_-]+)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.generic.html"
},
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
},
"patterns": [
{
"include": "#string"
}
],
"name": "entity.other.attribute-name.html",
],
"name": "entity.other.attribute-name.html",
"end": "(?<='|\"|)"
},
},
"tag_id_attribute": {
"begin": "\\b(id)\\b\\s*(=)",
"begin": "\\b(id)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.id.html"
},
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
},
"end": "(?<='|\"|)",
"name": "meta.attribute-with-value.id.html",
"name": "meta.attribute-with-value.id.html",
"patterns": [
{
"include": "#string"
}
]
},
},
"tag-stuff": {
"patterns": [
{
"include": "#tag_id_attribute"
},
},
{
"include": "#tag_generic_attribute"
},
},
{
"include": "#string"
},
},
{
"include": "#block_comments"
},
},
{
"include": "#comments"
},
},
{
"include": "#block_helper"
},
},
{
"include": "#end_block"
},
},
{
"include": "#partial_and_var"
}
]
}
},
"scopeName": "text.html.handlebars",
},
"scopeName": "text.html.handlebars",
"patterns": [
{
"include": "#yfm"
},
},
{
"include": "#block_comments"
},
},
{
"include": "#comments"
},
},
{
"include": "#block_helper"
},
},
{
"include": "#end_block"
},
},
{
"include": "#partial_and_var"
},
},
{
"include": "#inline_script"
},
@ -751,16 +751,16 @@
{
"include": "text.html.basic"
}
],
],
"fileTypes": [
"handlebars",
"handlebars.html",
"hbr",
"hbrs",
"hbs",
"mustache",
"template",
"handlebars",
"handlebars.html",
"hbr",
"hbrs",
"hbs",
"mustache",
"template",
"tmpl"
],
],
"uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484"
}

View File

@ -5,8 +5,8 @@ layout: post
title: "Test"
date: 2013-02-13 15:36
comments: true
external-url:
categories:
external-url:
categories:
---
<!doctype html>
@ -45,7 +45,7 @@ categories:
<div class="content_container">
{{{content}}}
</div>
<div id="gallery">
{{#each content.galleryImages}}
<a href="{{../content.fullBaseUrl}}{{imageUrl}}">
@ -60,13 +60,13 @@ categories:
{{@key}}: {{this}}
{{/each}}
</div>
{{#if date}}
<h3 class="date">{{date}}</h3>
{{else}}
<h3 class="no_date">No date available.</h3>
{{/if}}
{{! <p>Not that interesting.}} <p>No comment.</p>
{{!-- <p>Even less interesting. {{#if otherCondition}}<strong>"{{otherTestToken}}"</strong> {{/if}}</p> --}} <p>Nothing to see here.</p>
{{!-- <p>Marginally less interesting. {{{testToken}}}</p> --}} <p>Move along.</p>
@ -109,4 +109,4 @@ categories:
</script>
</body>
</html>
</html>

View File

@ -41,12 +41,12 @@
{{! Ember ArrayController implicit each loop }}
<ul>
{{#each}}
<li>{{name}} by {{artist}}</li>
{{/each}}
{{#each}}
<li>{{name}} by {{artist}}</li>
{{/each}}
</ul>
{{! with ... as }}
{{#with foo as bar}}
<li>{{name}} by {{artist}}</li>
{{/with}}
<li>{{name}} by {{artist}}</li>
{{/with}}