PDA

View Full Version : HTML, not bbcode is displayed on edit


flashfocus
06-14-2009, 07:58 AM
Hi,

I'm trying to implement this mod:
https://vborg.vbsupport.ru/showthread.php?t=93071&page=4

I've added the following:

if (!function_exists('handle_bbcode_xml'))
{
function handle_bbcode_xml(&$parser, $code, $type)
{
return handle_bbcode_highlight( $parser, $code, 'XML' );
}
}

$this->tag_list['no_option']['xml'] = array(
'callback' => 'handle_external',
'strip_empty' => true,
'stop_parse' => true,
'disable_smilies' => true,
'disable_wordwrap' => true,
'strip_space_after' => 1,
'external_callback' => 'handle_bbcode_xml'
);

So now I would be able to highlight XML using [highlight=XML] and [XML]. These both work. However, when I edit or quote a post with highlighted syntax, only the [highlight=xml] gets turned back into bbcode. The [xml] tag just displays the HTML it generated.

When I look in my database, the bb-code is still there, so why am I seeing the generated html in stead of the bbcode ?

https://vborg.vbsupport.ru/attachment.php?attachmentid=100554&stc=1&d=1244970036
All help is appreciated!! :)

Dismounted
06-14-2009, 08:59 AM
Add this to a plugin at bbcode_start:
$this->unparsed_tags[] = 'xml';

flashfocus
06-14-2009, 09:47 AM
Alright, that seems to do the trick! I didn't knew I had to do this since the original product uses [highlight], which is already a standard bbcode tag and get's added to unparsed_tags that way, right ? :)

Thanks!

NLP-er
10-07-2009, 10:42 PM
Add this to a plugin at bbcode_start:
$this->unparsed_tags[] = 'xml';

I used this and in Fireofox and Opera it is ok, but in IE I have parsed BBCode... What to do?

Correction: only in Opera it works fine :(

NLP-er
10-10-2009, 03:55 PM
I used this and in Fireofox and Opera it is ok, but in IE I have parsed BBCode... What to do?

Correction: only in Opera it works fine :(

Any hint what do do to assure that BBCode will never be parsed inside of editor? No matter which browser is used...