<?xml version="1.0" encoding="windows-1252"?>
<node id="439309" title="Code tags warning" created="2005-03-14 10:33:42" updated="2005-08-15 08:01:14">
<type id="1036">
monkdiscuss</type>
<author id="300037">
Roy Johnson</author>
<data>
<field name="doctext">
It seems to me that there are an awful lot of posts that get botched for lack of code tags. Naturally, there are none in [id://28877] at the moment, but there are always [438759|some] such posts around.
&lt;p&gt;
I thought that a fairly simple heuristic could be added to the posting feature to look for likely code chunks, and if there are no code tags around them, give a "Woah there!" message that suggests maybe they want to wrap code tags around some of their post.
&lt;p&gt;
I present the heuristics I thought of in Jeff Foxworthy format. If you have better ideas or reasons these aren't a good idea, discuss.
&lt;h4&gt;You might need code tags if...&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;you've got a single digit in square brackets
&lt;li&gt;&lt;code&gt;[$&lt;/code&gt; appears in your post
&lt;li&gt;you have lines ending in semicolons
&lt;li&gt;you have lines beginning with spaces or tabs
&lt;/ul&gt;
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-300037"&gt;
&lt;hr&gt;
&lt;small&gt;&lt;b&gt;Caution:&lt;/b&gt; Contents may have been coded under pressure.&lt;/small&gt;
&lt;/div&gt;&lt;/div&gt;</field>
</data>
</node>
