mirror of
https://gitee.com/vuejs/vue.git
synced 2024-12-04 13:07:40 +08:00
parent
59860b0a75
commit
c21b89ebed
@ -92,7 +92,7 @@ export function genClassSegments (
|
||||
classBinding: ?string
|
||||
): Array<StringSegment> {
|
||||
if (staticClass && !classBinding) {
|
||||
return [{ type: RAW, value: ` class=${staticClass}` }]
|
||||
return [{ type: RAW, value: ` class="${JSON.parse(staticClass)}"` }]
|
||||
} else {
|
||||
return [{
|
||||
type: EXPRESSION,
|
||||
|
@ -1245,6 +1245,20 @@ describe('SSR: renderToString', () => {
|
||||
})
|
||||
})
|
||||
|
||||
// #7859
|
||||
it('should not double escape class values', done => {
|
||||
renderVmWithOptions({
|
||||
template: `
|
||||
<div>
|
||||
<div class="a\nb"></div>
|
||||
</div>
|
||||
`
|
||||
}, result => {
|
||||
expect(result).toContain(`<div class="a\nb"></div>`)
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should expose ssr helpers on functional context', done => {
|
||||
let called = false
|
||||
renderVmWithOptions({
|
||||
|
Loading…
Reference in New Issue
Block a user