1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
suite 'Text Processing', ->
test 'Escaping element value', ->
eq(
xml('root', { headless: true })
.ele('e', 'escaped <>\'"&\t\n').up()
.ele('e', 'escaped <>\'"&\t\r\n').up()
.ele('e', 'escaped <>\'"&\t\n\r').up()
.ele('e')
.att('a1', 'escaped <>\'"&\t\n')
.att('a2', 'escaped <>\'"&\t\r')
.att('a3', 'escaped <>\'"&\t\n\r')
.att('a4', 'escaped <>\'"&\t\r\n')
.up()
.end()
'<root>' +
'<e>escaped <>\'"&\t\n</e>' +
'<e>escaped <>\'"&\t
\n</e>' +
'<e>escaped <>\'"&\t\n
</e>' +
'<e' +
' a1="escaped <>\'"&	
"' +
' a2="escaped <>\'"&	
"' +
' a3="escaped <>\'"&	

"' +
' a4="escaped <>\'"&	
"' +
'/>' +
'</root>'
)
|