WYSIWYG and Yahoo Pipes code

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 17, 2008   (RSS)

Hi guys,

Having a slight issue with the HTML area of the WYSIWYG editor. Most code snippets I paste in work fine, but when I paste in a Yahoo Pipe snippet:

<script src="http://pipes.yahoo.com/js/listbadge.js">{"pipe_id":"f3aca17d8dbf219df5c021053688be33","_btype":"list"}</script>

It changes it to this upon saving:

<script src="http://pipes.yahoo.com/js/listbadge.js"><!--
{"pipe_id":"f3aca17d8dbf219df5c021053688be33","_btype":"list"}
// --></script>

Note the comment characters being added. This causes the Yahoo Pipe to return no results. Any ideas?

Re: [benedict] WYSIWYG and Yahoo Pipes code

By Dave - September 17, 2008

Hi benedict,

I had a quick look through the tinymce source code. It looks like this is hard coded behavior. Having script content inside a comment or CDATA tag is actually what it is suppose to be for valid HTML. I'm surprised that yahoo doesn't support that.

Try this code before you display that variable:
<?php $yourVariable = preg_replace("|(<script.*?\s*>)<!--\s*(.*?)\s*// -->(</script>)|", "$1$2$3", $yourVariable);

It should strip out the comment for you.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com