define(['tpl!taoQtiItem/qtiXmlRenderer/tpl/container'], function(tpl){ var xhtmlEntities = function(html){ //@todo : check other names entities return html.replace(/ /g, ' '); }; var xhtmlEncode = function(encodedStr){ var returnValue = ''; if(encodedStr){ // are replaced by returnValue = encodedStr; returnValue = returnValue.replace(/]*)?>/ig, '
'); returnValue = returnValue.replace(/]*)?>/ig, '
'); // are replaced by returnValue = returnValue.replace(/(]*)?\s?[^\/]>)+/ig, function($0, $1){ return $0.replace('>', ' />'); }); } return returnValue; }; return { qtiClass : '_container', template : tpl, getData:function(container, data){ data.body = xhtmlEntities(data.body); data.body = xhtmlEncode(data.body); return data; } }; });