Changes between Initial Version and Version 1 of Ticket #18311, comment 23
- Timestamp:
- 01/21/2012 06:41:41 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #18311, comment 23
initial v1 1 1 I'm playing around with some escaping options, and the most elegant (chances are that it is not the most supported) solution is to use `JSON.stringify()` and `JSON.parse()`. 2 2 3 `JSON` is a native JSON encoding/decoding browser feature with IE6> cross-browser support [1] 3 `JSON` is a native JSON encoding/decoding browser feature with IE6> cross-browser support: 4 http://en.wikipedia.org/wiki/JSON#Native_encoding_and_decoding_in_browsers 4 5 5 Other ideas include `encodeURIComponent()` on JS side and `urldecode()`. We can't use `escape()` since there's no straight alternative to decode escaped strings on the PHP side (try this with languages like Tamil [2])6 Other ideas include `encodeURIComponent()` on JS side and `urldecode()`. We can't use `escape()` since there's no straight alternative to decode escaped strings on the PHP side (try this with languages like Tamil http://en.wikipedia.org/wiki/Tamil_language) 6 7 7 8 The biggest problem though, is that we will need to filter what tags are supported in the caption, where I would stick to basic `span,a,em,strong,del,[insert markup tags here]` (could not find a reason why would someone insert a `<table>` in a caption). For this we will definitely need a textarea instead of existing input type field and a UI markup editor, which is an unanswered question atm (both MCE and quicktags do not fit, unless we leave textarea use plain HTML). 8 9 9 10 Need some dev feedback. 10 11 [1]: http://en.wikipedia.org/wiki/JSON#Native_encoding_and_decoding_in_browsers12 [2]: http://en.wikipedia.org/wiki/Tamil_language