SpecialConvert, v1.01

Download (Zip File)
Download (Plain Text)

Installation

Just drop the .PL file in your plugins folder and chmod 755. If you don't have a plugins folder, create one in the same folder as the mt.cgi file.

What It Does

This is a text filter that can also be called via global attribute.

The default 'Convert Line Breaks' option puts a <p> before every block, </p> after every block, and <br> between lines inside a block. Special Convert allows you to change the HTML used in each of these cases, via your blog's plugins setup screen.

You may also apply it to specific tags via a global attribute do_special_convert. It takes three values separated by the vertical bar: before a block, after a block, between lines in a block.

<$MTTag do_special_convert="<p>|</p>|<br>"$> This replicates the behavior of 'Convert Line Breaks'.
<$MTTag do_special_convert="||<br><br>"$> Giving no information for one of the three expected values makes the plugin use the default value specified in your blog's settings. So in this case, lines within blocks are separated by two linebreaks, and the rest defaults to your settings.
<$MTTag do_special_convert=".|<br>|<br>"$> A single period is ignored, but will not cause the plugin to fall back on the default values. So in this case, nothing will be added before a block, while a linebreak will be added between lines and after a block.
<$MTTag do_special_convert="<p>|</p>|...."$> In fact, the first period of any value will be ignored. So in this case, a string of only three periods will be placed betweens lines in a block.

Note: I'm not 100% sure this works as a text filter, but the global attribute works perfectly.

Version History

v1.01 - Original version (with same-day bugfixes). [17 December 2006]

This plugin is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.
To contact the author, send mail to the "webmaster" of this domain.