Page 1 of 2

KTML messes up embedded code pasted into code view

Posted: 2010-05-19 05:15
by spike21
Hi all, I must say, it's good to see people still using KTML and trying to support it. I agree, it's still the best out there. It's a shame they shut it down.

Anyway, I've come across a problem where KTML breaks embedded code that is pasted into code view. The examples I have is this (the original):

Code: Select all

<div style="width:600px; text-align: center;"><embed type="application/x-shockwave-flash" wmode="transparent" src="http://w864.photobucket.com/pbwidget.swf?pbwurl=http%3A%2F%2Fw864.photobucket.com%2Falbums%2Fab206%2Fowenmcc1956%2FWelcome+to+Otahuhu+Intermediate+School%2F02386cf2.pbw" height="180" width="600"><a href="http://photobucket.com/slideshows" target="_blank"><img src="http://pic.photobucket.com/slideshows/btn.gif" style="float:left;border-width: 0;" ></a><a href="http://s864.photobucket.com/albums/ab206/owenmcc1956/Welcome%20to%20Otahuhu%20Intermediate%20School/?action=view&current=02386cf2.pbw" target="_blank"><img src="http://pic.photobucket.com/slideshows/btn_viewallimages.gif" style="float:left;border-width: 0;" ></a></div>
turns into this upon save:

Code: Select all

<div style="width: 600px; text-align: center;"><embed type="application/x-shockwave-flash" wmode="transparent" src="http://w864.photobucket.com/pbwidget.swf?pbwurl=http%253A%252F%252Fw864.photobucket.com%252Falbums%252Fab206%252Fowenmcc1956%252FWelcome+to+Otahuhu+Intermediate+School%252F02386cf2.pbw" height="180" width="600"><a href="http://photobucket.com/slideshows" target="_blank"><img src="http://pic.photobucket.com/slideshows/btn.gif" style="float: left; border-width: 0pt;"></a><a href="http://s864.photobucket.com/albums/ab206/owenmcc1956/Welcome%20to%20Otahuhu%20Intermediate%20School/?action=view&current=02386cf2.pbw" target="_blank"><img src="http://pic.photobucket.com/slideshows/btn_viewallimages.gif" style="float: left; border-width: 0pt;"></a></div>
I'm hoping someone has come across this before. I can't see any configuration options that could stop this from happening. It seems to be re-escaping the escaped url's.

Cheers,

Brendon

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-19 09:08
by Fred
Have you tried ticking or un-ticking the save text as XML box?

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-24 05:22
by spike21
Hi Fred, thanks for the reply :)

I've abstracted the KTML code out into a Rails app, so I only have the code now (not the dreamweaver extension that generates the code). I was trying to find that property and can only see this vague reference:

Code: Select all

		$ktml_{$_GET['inputid']}->setModuleProperty("xhtml", "AllowedModule", "true", false);
		$ktml_{$_GET['inputid']}->setModuleProperty("xhtml", "xhtml_view_source", "false", true);
		$ktml_{$_GET['inputid']}->setModuleProperty("xhtml", "xhtml_save", "false", true);
ignore the $_GET stuff, that's proprietary to my app. Are any of those options the ones I want to disable?

I couldn't see anything relevant in KT_config.inc.php or ktml4.config.php

Thanks for your help! :)

Brendon

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-24 05:34
by spike21
Just following that up. I tried setting xhtml allowedmodule to false and that disables xhtml save, but it still mangles the code. The code mangling happens when you switch back to code view after pasting your code and leaving code view so I guess it's something deeper :) It appears that KTML is re-escaping the percentage signs. Perhaps this is a safety precaution?

Any ideas would be greatly appreciated :)

Cheers,

Brendon

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-24 09:15
by Fred
Just tested it on a default KTML installation and it does it as soon as you switch over from the code view to design view so I think you are right in saying it is a security feature.

One of the site members mentioned a while ago he "patched" his ktlm code to allow more tags. Unfortunately I can't remember who it was. Will see if I can find him... or maybe he will see this post and be able to help you out.

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-24 11:35
by spike21
Thanks Fred :) I've used the settings to allow all tags except for IFRAMES so I don't think that's the precise bit of code that's doing it. I think somewhere along the lines it's just escaping the percentage signs of escaped characters it doesn't recognise. I found it unusual that this site would escape the :// in http:// ! However when trying the original code in notepad it still actually works so I'm guessing they do it to help people get around fussy code filters and the like. Too bad KTML is even fussier!

Cheers,

Brendon

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-24 11:40
by spike21
Looks like this guy found the same problem. Not sure if it was ever fixed though:

http://doc.gestalt-inc.com/wiki/index.p ... le_Element

Re: KTML messes up embedded code pasted into code view

Posted: 2010-05-24 13:48
by Fred
Interesting...
Maybe you should contact them and see if they got it fixed or use their workaround for now.

The changes that was made to allow other tags was made in the .js file somewhere.

Re: KTML messes up embedded code pasted into code view

Posted: 2011-04-13 16:29
by ianraba
Did anyone resolve this or able to push me in the right direction?

I have a lightbox that needs to be included with parameters within []
like previous comments cut and paste into the wysiwyg causes the [ and ] to be mangled

ANy ideas?

Re: KTML messes up embedded code pasted into code view

Posted: 2011-04-14 09:05
by spike21
Sorry bro, was never able to solve it. If you are able to find a way let me know :D I'd say it's burried somewhere deep in their code :)

On a side note, I've got my eyes on the Aloha Editor, I think that's going to be the next big thing and will blow these box based editors out of the water. It's open source too, and the developers are very up to date and savvy :)

Cheers,

Brendon