nothing happens then...
only <textarea ... /> gets changed to <textarea ...></textarea>

Now, if this is in a comment it also gets changed :)
But i guess it doesn't hurt anyone, and in either case,
that's how it was originally emitted from the server...
The client serializer turns it into <textarea/> and we turn it back...

ok, i'll try to commit

Leonardo Quijano Vincenzi wrote:

> What happens if we put a comment that says "<textarea></textarea>"??
>
> Doesn't that get parsed too?
>
> As for the fix, go ahead and commit if you think it's fine. I'm having
> this problem too, btw.
>
> Andreas Andreou wrote:
>
>> The correct idea :)
>>
>> In tacos.js, in tacos.loadElement we do:
>> localElement.innerHTML=tacos.getContentAsString(contents);
>>
>> Do a dojo.debug on this, and you'll see <textarea/> !
>>
>> In firefox, tacos.getContentAsString calls
>> tacos._getContentAsStringMozilla
>> which in turn uses the XMLSerializer which is responsible for changing
>> <textarea></textarea> into <textarea/>.
>>
>> I haven't been able to find any method that alters the behaviour of the
>> serializer,
>> so maybe the simplest fix would be doing a search and replace.
>>
>> Here's the code - or should I commit since I now have access ? :)
>>
>> function fixTextarea(content)
>> {
>>     var taMatcher = '<textarea(.*?)/>';
>>     var match = new RegExp(taMatcher);
>>     content = content.replace(match, "<textarea$1></textarea>");
>>        if (content.match(match))
>>         return fixTextarea(content);
>>     else
>>         return content;
>> }
>>
>> and some tests
>>
>> function tests()
>> {
>>   alert(fixTextarea("blah<textarea id='1'/>more <b>content</b>"));
>>   alert(fixTextarea("<textarea id='1'  />more <b>content</b>"));
>>   alert(fixTextarea("<textarea id='1'/><textarea id='2'/>"));
>>   alert(fixTextarea("<textarea id='1'></textarea>more <b>content</b>"));
>>   alert(fixTextarea("<textarea id='1'>more <b>content</b>
>> here!</textarea>"));
>>   alert(fixTextarea("<textarea/>"));
>> }
>>
>> Jesse Kuhnert wrote:
>>   
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to