diff --git a/src/language-html/printer-html.js b/src/language-html/printer-html.js index b8611902b6e4..42278d48437a 100644 --- a/src/language-html/printer-html.js +++ b/src/language-html/printer-html.js @@ -128,8 +128,10 @@ function embed(path, print, textToDoc, options) { return concat([ node.rawName, '="', - mapDoc(embeddedAttributeValueDoc, doc => - typeof doc === "string" ? doc.replace(/"/g, """) : doc + group( + mapDoc(embeddedAttributeValueDoc, doc => + typeof doc === "string" ? doc.replace(/"/g, """) : doc + ) ), '"' ]); diff --git a/tests/html_vue/__snapshots__/jsfmt.spec.js.snap b/tests/html_vue/__snapshots__/jsfmt.spec.js.snap index d3fd4f7a21f5..602924e5c069 100644 --- a/tests/html_vue/__snapshots__/jsfmt.spec.js.snap +++ b/tests/html_vue/__snapshots__/jsfmt.spec.js.snap @@ -26,6 +26,7 @@ printWidth: 80 @click=" $emit( 'click' ) " @click=" $emit( 'click' ) ;" @click=" $emit( 'click' ) ;if(something){for(let i=j;i<100;i++){}}else{}" + slot-scope="{row}" slot-scope="{destructuring:{a:{b}}}" :class="{ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true }" :class="(() => { return 'hello' })()" @@ -71,6 +72,7 @@ printWidth: 80 } else { } " + slot-scope="{ row }" slot-scope="{ destructuring: { a: { b } @@ -133,6 +135,7 @@ trailingComma: "es5" @click=" $emit( 'click' ) " @click=" $emit( 'click' ) ;" @click=" $emit( 'click' ) ;if(something){for(let i=j;i<100;i++){}}else{}" + slot-scope="{row}" slot-scope="{destructuring:{a:{b}}}" :class="{ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true }" :class="(() => { return 'hello' })()" @@ -178,6 +181,7 @@ trailingComma: "es5" } else { } " + slot-scope="{ row }" slot-scope="{ destructuring: { a: { b }, diff --git a/tests/html_vue/attributes.vue b/tests/html_vue/attributes.vue index 17f6b534f002..e1e16c96babd 100644 --- a/tests/html_vue/attributes.vue +++ b/tests/html_vue/attributes.vue @@ -18,6 +18,7 @@ @click=" $emit( 'click' ) " @click=" $emit( 'click' ) ;" @click=" $emit( 'click' ) ;if(something){for(let i=j;i<100;i++){}}else{}" + slot-scope="{row}" slot-scope="{destructuring:{a:{b}}}" :class="{ longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong: true }" :class="(() => { return 'hello' })()"