Handling of the HTML "pre" tag

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
bakabaka
Posts: 15
Joined: Thu Mar 10, 2005 12:45 am
Location: USA
Contact:

Handling of the HTML "pre" tag

Post by bakabaka »

It appears that the handling of the HTML "pre" tag has changed in version 1.5. In previous (1.4.x) versions, it would work as expected if it were placed in an article. With the current version though, preformatted text made with the "pre" tag takes on a reddish hue and the PHP tags within it become visible when viewed in the FAQ itself (not in the editor.) I'm not sure why this happens just yet, but hopefully this information is useful.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

yes, there's s bug in 1.5.0, only <code> should be highlighted as PHP code.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bakabaka
Posts: 15
Joined: Thu Mar 10, 2005 12:45 am
Location: USA
Contact:

Post by bakabaka »

Hi Thorsten,

In version 1.5.0, when I modify line 103 in artikel.php from the following:

Code: Select all

"writeContent" => preg_replace_callback("/<pre([^>]*)>(.*?)<\/pre>/is", 'hilight', $content),
back to this:

Code: Select all

"writeContent" => $content,
as it was in previous versions of phpMyFAQ, this seems to fix the issue with PHP tags showing up arbitrarily within preformatted text blocks. Somehow, PHP tags seem to be getting trapped within the preformatted text tags and getting displayed rather than being parsed.

Hope this helps!
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

it should be better:

Code: Select all

"writeContent" => preg_replace_callback("/<code([^>]*)>(.*?)<\/code>/is", 'hilight', $content),
bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
bakabaka
Posts: 15
Joined: Thu Mar 10, 2005 12:45 am
Location: USA
Contact:

Post by bakabaka »

Hi Thorsten,

Ah, that makes more sense. Thank you!
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

it's fixed in CVS and the fix will be released in 1.5.1.

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