WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #18311, comment 23


Ignore:
Timestamp:
01/21/12 18:41:41 (3 years ago)
Author:
sushkov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #18311, comment 23

    initial v1  
    11I'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()`. 
    22 
    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: 
     4http://en.wikipedia.org/wiki/JSON#Native_encoding_and_decoding_in_browsers 
    45 
    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]) 
     6Other 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) 
    67 
    78The 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). 
    89 
    910Need some dev feedback. 
    10  
    11 [1]: http://en.wikipedia.org/wiki/JSON#Native_encoding_and_decoding_in_browsers 
    12 [2]: http://en.wikipedia.org/wiki/Tamil_language