Skip to content
Browse files

Fixed snippets formatting

  • Loading branch information...
1 parent 25b4ca8 commit f93a3f09fc53e9949401b207cdc606cbca7b5fff @sergeche sergeche committed
Showing with 6 additions and 1 deletion.
  1. +5 −1 javascript/filters/format.js
  2. +1 −0 javascript/unittest/tests/expandAbbreviation.js
View
6 javascript/filters/format.js
@@ -78,6 +78,10 @@ emmet.exec(function(require, _){
});
}
+ function isRoot(item) {
+ return !item.parent;
+ }
+
/**
* Processes element with matched resource of type <code>snippet</code>
* @param {AbbreviationNode} item
@@ -88,7 +92,7 @@ emmet.exec(function(require, _){
item.start = item.end = '';
if (!isVeryFirstChild(item) && profile.tag_nl !== false && shouldAddLineBreak(item, profile)) {
// check if we’re not inside inline element
- if (!require('abbreviationUtils').isInline(item.parent)) {
+ if (isRoot(item.parent) || !require('abbreviationUtils').isInline(item.parent)) {
item.start = require('utils').getNewline() + item.start;
}
}
View
1 javascript/unittest/tests/expandAbbreviation.js
@@ -158,6 +158,7 @@
runTest('pos:s', 'css', 'position: static;');
runTest('ti:-', 'css', 'text-indent: -9999px;');
runTest('bdb+', 'css', 'border-bottom: 1px solid #000;');
+ runTest('p10+poa', 'css', 'xhtml', 'padding: 10px;\nposition: absolute;');
});
test('Inheritance', function() {

0 comments on commit f93a3f0

Please sign in to comment.
Something went wrong with that request. Please try again.