3 | | How do we want to encode complex (array|object) attributes? [https://github.com/airve/phat/blob/4835480c3c925023199eef65b22ded9866f50b66/wphat.php#LC113 Currently] it checks for the ~10 attributes that take tokens (`[class]`, `[media]`, [http://dev.w3.org/html5/spec-author-view/index.html#attributes-1 etc.]) and implode them with the correct glue. Otherwise it uses `json_encode`. Should we skip the check and go with the simple approach of using `json_encode` for any complex value? In either case I'll include a `'complex_attr_value'` filter. |
4 | | |
5 | | I avoided `esc_attr` b/c it breaks JSON and b/c it double-encodes entities. |
| 3 | How do we want to encode complex (array|object) attributes? [https://github.com/airve/phat/blob/4835480c3c925023199eef65b22ded9866f50b66/wphat.php#LC113 Currently] it checks for the ~10 attributes that take tokens (`[class]`, `[media]`, [http://dev.w3.org/html5/spec-author-view/index.html#attributes-1 etc.]) and implode them with the correct glue. Otherwise it uses `json_encode`. Should we skip the check and go with the simple approach of using `json_encode` for any complex value? In either case I'll include a `'complex_attr_value'` filter. I avoided `esc_attr` b/c it breaks JSON and b/c it double-encodes entities. |