Here's a code fix to MT to do what you want, if you're determined. This works on
my weblogfor the Textile text formatting. Go to the weblog and click on the comments for some post. Put this in the comment text:
CODE
Bob M^c^Groovy is a cool dude.
Bob M<sup>c</sup>Groovy is a cool dude.
Then hit PREVIEW. Note that the textile superscript (denoted by '^c^') works but the SUP element is stripped.
The changes are in MT/lib/Template/Context.pm.
Change 1:
In post_process_handler, which starts around line 224, move the Sanitize logic up so that it looks like
CODE
if ($args) {
my %local_args = %$args;
if (my $spec = $local_args{'sanitize'}) { # START OF MOVED SECTION
require MT::Sanitize;
if ($spec eq '1') {
$spec = $ctx->stash('blog')->sanitize_spec ||
MT::ConfigMgr->instance->GlobalSanitizeSpec;
}
$str = MT::Sanitize->sanitize($str, $spec);
} # END OF MOVED SECTION
for my $arg (keys %local_args) {
if (my $code = $Global_filters{$arg}) {
$str = $code->($str, $args->{$arg}, $ctx);
delete $local_args{$arg};
}
}
Change 2: Around line 1175 in the _hdlr_comment_body subroutine, change the lines at the end of sub from
CODE
return $convert_breaks ?
MT->apply_text_filters($t, $blog->comment_text_filters, $ctx) :
$t;
to
CODE
if ($convert_breaks) {
if (my $filters = join(',', @{$blog->comment_text_filters()})) {
$filters = $filters . ',' . $arg->{'filters'} if $arg->{'filters'};
$arg->{'filters'} = $filters;
}
}
return $t;
The last bit is experimental. It works for me but I haven't tested it in all cases. Now all you need is a text filter to make the smileys. If you do that by adding a "filters" attribute or global filter attribute (like apply_macros="1") then you don't need change 2, which handles the case of the filter set in the weblog config.