Problem with adding html/xml code examples in article

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
cuberbox
Posts: 3
Joined: Thu Feb 17, 2011 10:34 pm

Problem with adding html/xml code examples in article

Post by cuberbox »

I can succesfully post in articles html/xml code example with Syntaxhighlighter or Code/Code sample paragraphs.
For example: <target name="copy_sxr_to_res">
Even when tinymce (visual editor) is turned off I can manually post it with manuall replacement of < and > symbols to < and > But if I try to edit this article html/xml tags are simply disappears in tinymce or in article itself. I understand the case of this (textarea do this replace and unknown tags is hiding by browser from page) - but in many projects this effect is suppressed, for example in this forum. How can I avoid or fix this, or is there any simple workaround?
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Problem with adding html/xml code examples in article

Post by Thorsten »

Hi,

did you use the SyntaxHighlighter Plugin?

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
cuberbox
Posts: 3
Joined: Thu Feb 17, 2011 10:34 pm

Re: Problem with adding html/xml code examples in article

Post by cuberbox »

Yes, I use SyntaxHighlighter, but it doesn't effects core problem. SyntaxHighlighter automatically changed string like

Code: Select all

<target name="copy_sxr_to_res">
to html

Code: Select all

<pre class="brush: xml;fontsize: 100; first-line: 1; "><target name="copy_sxr_to_res"></pre>
Symbols < and > changed to < and > and then saved to DB. I can view this post and it is all right. But only until I try to edit article.

When I try to edit it - textarea on edit form shows string like this:

Code: Select all

<pre class="brush: xml;fontsize: 100; first-line: 1; "><target name="copy_sxr_to_res"></pre>
Symbols < and > changed back. In tinymce the strings with tags are simply disappeared. And if I save this post again - tags disappeared from article: they saved to DB, but with < and > browser assumes it as unknown html tags. Only one way to post in this case is again and manually replace all < and > to < and >, and only with original source html (tinymce must be off - even in html mode in tinymce this tags are not shown).
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Problem with adding html/xml code examples in article

Post by Thorsten »

Hi,

okay, I'll check this issue.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
cuberbox
Posts: 3
Joined: Thu Feb 17, 2011 10:34 pm

Re: Problem with adding html/xml code examples in article

Post by cuberbox »

Thorsten wrote:okay, I'll check this issue.
Hi! Is there any news about it? Is it fixed in newer versions?
Thorsten
Posts: 15815
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Problem with adding html/xml code examples in article

Post by Thorsten »

Hi,

this should be fixed in 2.7, yes. The 2.6 version mentioned above is already out of support.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply