<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Friday, July 21, 2006, 7:40 AM -->
<!-- MuClient version 3.75 -->

<!-- Plugin "Convert_code_to_pre" generated by Plugin Wizard -->

<muclient>
<plugin
   name="Convert_code_to_pre"
   author="Nick Gammon"
   id="3a5eb2e81de87a4a90616807"
   language="Lua"
   purpose="Converts &lt;code&gt; tags to &lt;pre&gt; tags"
   date_written="2006-07-21 07:35:12"
   requires="3.67"
   version="1.0"
   >
<description trim="y">
<![CDATA[
Converts <code> tags in incoming packets to <pre> tags.
]]>
</description>

</plugin>


<!--  Script  -->


<script>
<![CDATA[

t = {
    ["<code>"] = "<pre>",
    ["<CODE>"] = "<pre>",
    ["</code>"] = "</pre><br>",
    ["</CODE>"] = "</pre><br>",
    ["<tt>"] = "<pre>",
    ["<TT>"] = "<pre>",
    ["</tt>"] = "</pre><br>",
    ["</TT>"] = "</pre><br>",
    }

function f (s)
  return t [s] or s
end -- f

function OnPluginPacketReceived (s)
  return (string.gsub (s, "</?%a+>", f))
end -- function OnPluginPacketReceived
]]>
</script>

</muclient>
