diff --git a/compiler/Parser.js b/compiler/Parser.js index baedf8093..606775c54 100644 --- a/compiler/Parser.js +++ b/compiler/Parser.js @@ -56,8 +56,8 @@ function mergeShorthandClassNames(el, shorthandClassNames, context) { prevClassName.value += ' ' + className.value; } else { finalClassNames.push(className); + prevClassName = className; } - prevClassName = className; } if (finalClassNames.length === 1) { diff --git a/test/autotests/render/shorthand-classes-many-classes/expected.html b/test/autotests/render/shorthand-classes-many-classes/expected.html new file mode 100644 index 000000000..00698ad25 --- /dev/null +++ b/test/autotests/render/shorthand-classes-many-classes/expected.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/test/autotests/render/shorthand-classes-many-classes/template.marko b/test/autotests/render/shorthand-classes-many-classes/template.marko new file mode 100644 index 000000000..0549b2d59 --- /dev/null +++ b/test/autotests/render/shorthand-classes-many-classes/template.marko @@ -0,0 +1,3 @@ +.foo.bar.baz.bat +.foo.bar.${data.cls}.baz +.foo.bar.baz class="test" \ No newline at end of file diff --git a/test/autotests/render/shorthand-classes-many-classes/test.js b/test/autotests/render/shorthand-classes-many-classes/test.js new file mode 100644 index 000000000..a44253e38 --- /dev/null +++ b/test/autotests/render/shorthand-classes-many-classes/test.js @@ -0,0 +1,3 @@ +exports.templateData = { + cls: 'test123' +};