Skip to content

Commit ccb7d23

Browse files
committed
test: not replace quote in arribute, issue #43
1 parent 93647af commit ccb7d23

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/render.test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,5 +351,25 @@ describe('PostHTML Render', function () {
351351
expect(render(fixture, options)).to.eql(expected)
352352
})
353353
})
354+
355+
describe('replaceQuote', function () {
356+
it('replace quote', function () {
357+
var options = { replaceQuote: false }
358+
359+
var fixture = { tag: 'img', attrs: { src: '<?php echo $foo["bar"] ?>' } }
360+
var expected = '<img src="<?php echo $foo["bar"] ?>">'
361+
fs.writeFileSync('test.html', render(fixture, options))
362+
expect(render(fixture, options)).to.eql(expected)
363+
})
364+
365+
it('replace quote ternary operator', function () {
366+
var options = { replaceQuote: false }
367+
368+
var fixture = { tag: 'img', attrs: { src: '<?php echo isset($foo["bar"]) ? $foo["bar"] : ""; ?>' } }
369+
var expected = '<img src="<?php echo isset($foo["bar"]) ? $foo["bar"] : ""; ?>">'
370+
fs.writeFileSync('test.html', render(fixture, options))
371+
expect(render(fixture, options)).to.eql(expected)
372+
})
373+
})
354374
})
355375
})

0 commit comments

Comments
 (0)