So after 2+ hours of working on this I finally found a solution, it's not very clean as you have to edit a class file from vbulletin but such is life.
This is done with version 3.6.7 PL1
open up
includes/class_bbcode_alt.php
1. Replace the second foreach loop in the `
vB_BbCodeParser_Wysiwyg` function on line 82 with this code:
PHP Code:
foreach (array('code', 'php', 'html','highlight') AS $pre_tag)
{
if (isset($this->tag_list['no_option']["$pre_tag"]))
{
$this->tag_list['no_option']["$pre_tag"]['callback'] = 'handle_preformatted_tag';
unset($this->tag_list['no_option']["$pre_tag"]['html'], $this->tag_list['option']["$pre_tag"]['strip_space_after']);
}
if (isset($this->tag_list['option']["$pre_tag"]))
{
$this->tag_list['option']["$pre_tag"]['callback'] = 'handle_preformatted_tag';
unset($this->tag_list['option']["$pre_tag"]['html'], $this->tag_list['option']["$pre_tag"]['strip_space_after']);
}
}
2. Replace `
handle_preformatted_tag` function with this code on line 179
PHP Code:
function handle_preformatted_tag($code)
{
$current_tag =& $this->current_tag;
if($current_tag['option']) {
return "[$current_tag[name]=$current_tag[option]]" . $this->emulate_pre_tag($code) . "[/$current_tag[name]]";
} else {
return "[$current_tag[name]]" . $current_tag['option']. " ". $this->emulate_pre_tag($code) . "[/$current_tag[name]]";
}
}