Merge pull request #308 from strk/aposquote
Fix escaping of single quote.
This commit is contained in:
commit
b9309a7f80
@ -10,7 +10,7 @@ tree.Quoted.prototype = {
|
||||
toString: function(quotes) {
|
||||
var xmlvalue = this.value
|
||||
.replace(/&/g, '&')
|
||||
.replace(/\'/g, ''')
|
||||
.replace(/\'/g, '\\\'')
|
||||
.replace(/\"/g, '"')
|
||||
.replace(/</g, '<')
|
||||
.replace(/\>/g, '>');
|
||||
|
@ -17,7 +17,7 @@ describe('Quoted', function() {
|
||||
it('should produce xml-friendly output', function() {
|
||||
var f = new tree.Quoted("Tom's & \"<quoted>\"");
|
||||
assert.ok(f);
|
||||
assert.equal(f.toString(true), "'Tom's & "<quoted>"'");
|
||||
assert.equal(f.toString(true), "'Tom\\'s & "<quoted>"'");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
<Style name="world" filter-mode="first">
|
||||
<Rule>
|
||||
<Filter>([name2] = ' Sa'ad')</Filter>
|
||||
<Filter>([name2] = ' Sa\'ad')</Filter>
|
||||
<PolygonSymbolizer fill="#ffffff" />
|
||||
</Rule>
|
||||
</Style>
|
||||
|
Loading…
Reference in New Issue
Block a user