mirror of
https://github.com/beautifier/js-beautify.git
synced 2025-02-25 15:53:04 +00:00
LESS pseudoclass inside a mixin fix
This commit is contained in:
parent
c374263b5a
commit
ed7138e598
@ -334,7 +334,7 @@ Beautifier.prototype.beautify = function() {
|
||||
}
|
||||
}
|
||||
} else if (this._ch === ":") {
|
||||
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend) {
|
||||
if ((insideRule || enteringConditionalGroup) && !(this._input.lookBack("&") || this.foundNestedPseudoClass()) && !this._input.lookBack("(") && !insideAtExtend && parenLevel < 1) {
|
||||
// 'property: value' delimiter
|
||||
// which could be in a conditional group query
|
||||
this.print_string(':');
|
||||
|
@ -10728,6 +10728,9 @@ function run_css_tests(test_obj, Urlencoded, js_beautify, html_beautify, css_bea
|
||||
'}\n' +
|
||||
'.mymixin(@color: #ccc; @border-width: 1px) {\n' +
|
||||
' border: @border-width solid @color;\n' +
|
||||
'}\n' +
|
||||
'strong {\n' +
|
||||
' &:extend(a:hover);\n' +
|
||||
'}');
|
||||
|
||||
|
||||
|
@ -358,7 +358,8 @@ class Beautifier:
|
||||
if (insideRule or enteringConditionalGroup) and \
|
||||
not (self._input.lookBack('&') or
|
||||
self.foundNestedPseudoClass()) and \
|
||||
not self._input.lookBack('(') and not insideAtExtend:
|
||||
not self._input.lookBack('(') and not insideAtExtend and \
|
||||
parenLevel < 1:
|
||||
# 'property: value' delimiter
|
||||
# which could be in a conditional group query
|
||||
self.print_string(":")
|
||||
|
@ -10603,6 +10603,9 @@ class CSSBeautifierTest(unittest.TestCase):
|
||||
'}\n' +
|
||||
'.mymixin(@color: #ccc; @border-width: 1px) {\n' +
|
||||
' border: @border-width solid @color;\n' +
|
||||
'}\n' +
|
||||
'strong {\n' +
|
||||
' &:extend(a:hover);\n' +
|
||||
'}')
|
||||
|
||||
|
||||
|
@ -1543,6 +1543,9 @@ exports.test_data = {
|
||||
'}',
|
||||
'.mymixin(@color: #ccc; @border-width: 1px) {',
|
||||
' border: @border-width solid @color;',
|
||||
'}',
|
||||
'strong {',
|
||||
' &:extend(a:hover);',
|
||||
'}'
|
||||
]
|
||||
}]
|
||||
|
Loading…
x
Reference in New Issue
Block a user