Forum closed. New forum available at http://community.wymeditor.org/

HTML Code Insertion Problem

Support forum for WYMeditor.

HTML Code Insertion Problem

Postby Mighty_Y on Sun Jan 06, 2008 10:20 am

I'm using Wymeditor as an editor for my weblog. I plan to post HTML code and PHP code to the blog, for tutorials and such.

I paste my code in Wymeditor inside a <pre> tag. I save the post and everything is great.
Now, when I want to edit the post there is a problem.
The text from the database is this:
Code: Select all
<pre> &nbsp;&nbsp;&nbsp; &lt;div id="leftcolumn"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;ul id="menu"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href="&lt;?=site_url("blog")?&gt;"&gt;&lt;img src="&lt;?=base_url()?&gt;media/images/site/menu/1-Blog.png" alt="Blog" title="Blog" /&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href="index.htm#blog"&gt;&lt;img src="&lt;?=base_url()?&gt;media/images/site/menu/2-Fotoalbum.png" alt="Foto's" title="Foto's" /&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href="index.htm#blog"&gt;&lt;img src="&lt;?=base_url()?&gt;media/images/site/menu/3-Projects.png" alt="Projecten" title="Projecten" /&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href="index.htm#blog"&gt;&lt;img src="&lt;?=base_url()?&gt;media/images/site/menu/4-Aboutme.png" alt="Over mij" title="Over mij" /&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href="index.htm#blog"&gt;&lt;img src="&lt;?=base_url()?&gt;media/images/site/menu/5-Links.png" alt="Links" title="Links" /&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;li&gt;&lt;a href="index.htm#blog"&gt;&lt;img src="&lt;?=base_url()?&gt;media/images/site/menu/6-Contact.png" alt="Contact" title="Contact" /&gt;&lt;/a&gt;&lt;/li&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/ul&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp; &lt;/div&gt;</pre>

as you can see, all tags nicely changed so they can be interpreted as text and not as html.

But when I load the database value in my textarea, wymeditor interpretes all my text-html as real-html :( Is there a way to change this?
Mighty_Y
 
Posts: 3
Joined: Sun Jan 06, 2008 10:11 am

Postby Mighty_Y on Tue Jan 15, 2008 2:23 pm

I don't like to bump, but I still haven't got an answer so I think it's appropriate...

*bump*
Mighty_Y
 
Posts: 3
Joined: Sun Jan 06, 2008 10:11 am

Postby pcdinh on Sun Jan 20, 2008 9:33 am

You cannot paste your HTML code into the editor when the rich text mode is on. You should switch the rich text mode to html mode before copying and pasting code. I suppose that you can see that button from the toolbar

Regards
pcdinh
 
Posts: 3
Joined: Sat Dec 22, 2007 1:56 pm

Postby Mighty_Y on Sun Jan 20, 2008 10:58 am

I think you did not read my post correctly. I stated that I "pasted the code in and then saved it without any problems". The problem starts when I get my correct code from the database and put that as a value in my textarea.
When wymeditor loads, it parses my html code that I want to display as text as html.

FYI, I switched to TinyMCE (I liked wymeditor for showing the containerstuff, but TinyMCE is better documented and has a richer API to develop plugins for) and it had the same problem. But I found on their website that I have to use htmlentities on the text from the database before inserting it into the textarea.

By doing that, it changes the & from &lt; etc, to &amp; so you get &amp;lt; and that doesn't get interpreted by the editor as html but just as text.

I found that within the hour on their website, here I get an incorrect answer after 14 days... If you want to get this editor known and used, you'll need to do something about your documentation, plugin documentation and forumsupport...
Mighty_Y
 
Posts: 3
Joined: Sun Jan 06, 2008 10:11 am


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests