escaped array attributes are broken

46 views
Skip to first unread message

pavelc...@gmail.com

unread,
Oct 1, 2014, 9:12:24 AM10/1/14
to polym...@googlegroups.com
I have json array (containing both apostrophe and quotes):
[{"type":"error","head":"Chyba na serveru","body":"Data truncation: Out of range value for column 'price' at row 1"}]

I want to give this array to custom element as attribute. So obvious way would be HTML code (xml escape):
messages="[{"type":"error","head":"Chyba na serveru","body":"Data truncation: Out of range value for column 'price' at row 1"}]"
But polymer won't parse this as array. If I don't escape value, it will break HTML code.

Also html escape doesn't work:
messages="[{"type":"error","head":"Chyba na serveru","body":"Data truncation: Out of range value for column 'price' at row 1"}]"

Note this works fine:
messages
='[{"type":"error","head":"Chyba na serveru","body":"Data truncation: Out of range value for column price at row 1"}]'

Rob Dodson

unread,
Oct 1, 2014, 10:27:20 AM10/1/14
to pavelc...@gmail.com, polymer-dev
Hm, yeah I'm seeing this too.I created a jsbin to reproduce it: http://jsbin.com/bucuqi/6/edit

The console logs the correct array values, you see the apostrophe, but the content doesn't display.

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/11dcc477-f685-406e-bfef-4cde8361bf32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rob Dodson

unread,
Oct 2, 2014, 3:53:41 PM10/2/14
to Pavel Cibulka, polymer-dev
Reply all
Reply to author
Forward
0 new messages