Yes, I've read Writeup Formatting Tips and Perl Monks Approved HTML tags and I'm well aware that <pre> tags are discouraged here, in general — for a number of good reasons which I do appreciate and normally abide by.
Still, occasionally, I use <pre> tags in place of <code> tags, because the former allow you to embed HTML markup, such as <b> or <i>, which will be honored when the <pre>-formatted section is rendered. IMHO, this does have its uses in a few selected cases, e.g. to highlight specific fragments in some program output, in order to make things easier to read. As far as I know, this is not possible within <code> sections (at least, I wouldn't know how).
With this reasoning in the back of my mind, I did make use of <pre> tags and <b>/bold highlighting in a recent node to have some debug output be rendered something like this:
... Just used Second in Data Methods are exported from First First::import(): @EXPORT_OK = ... After using First in Second ...
And that's what it looked like initially when I had posted the node. After having reloaded it about half an hour later, however, it looked like this
... Just used Second in Data Methods are exported from First <b>First::import()</b>: @EXPORT_OK = ... After using First in Second ...
apparently because someone had replaced the <pre> tags with <c> tags (or do we in the meantime have an automatic mechanism which periodically goes through all nodes to replace any evil <pre> tags? — if so, I missed it being announced on What's new.)
Okay, not a big issue. But what particularly surprised me was the relatively short time frame within which this happened. Otherwise, it often takes a whole day or longer until considered nodes are finally being fixed, even if they display as some illegible blob of text and code all mixed up in one paragraph.
So I'm wondering what sin I have committed that made immediate action necessary :) — while the parent node, for example - which has been considered for not using code tags - is still waiting for some benevolent janitor's intervention at the time of this writing...
It can hardly have been the line length, because the longest line in the snippet in question is just 69 characters. Also, I can't imagine why anyone would want to one-click-download some dull debug output, or have the snippet be decorated with the line numbering that <code> tags optionally offer.
So, to recap, is there anything unconditionally wrong with using <pre> tags? If so, why not disable them entirely in the first place?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: <pre> vs. <code> tags
by Arunbear (Prior) on Apr 26, 2008 at 09:10 UTC | |
by tye (Sage) on Apr 26, 2008 at 16:39 UTC | |
by chromatic (Archbishop) on Apr 27, 2008 at 00:43 UTC | |
Re: <pre> vs. <code> tags
by CountZero (Bishop) on Apr 25, 2008 at 23:17 UTC | |
by almut (Canon) on Apr 25, 2008 at 23:30 UTC | |
by tye (Sage) on Apr 26, 2008 at 03:33 UTC | |
by almut (Canon) on Apr 26, 2008 at 10:35 UTC | |
by Anonymous Monk on Apr 26, 2008 at 07:19 UTC | |
Re: <pre> vs. <code> tags
by naikonta (Curate) on Apr 29, 2008 at 03:32 UTC | |
Re: <pre> vs. <code> tags
by John M. Dlugosz (Monsignor) on May 02, 2008 at 04:05 UTC | |
Re: <pre> vs. <code> tags
by chromatic (Archbishop) on Apr 26, 2008 at 16:16 UTC | |
by tye (Sage) on Apr 26, 2008 at 17:19 UTC | |
by Your Mother (Archbishop) on Apr 26, 2008 at 19:11 UTC | |
by tye (Sage) on Apr 27, 2008 at 03:31 UTC |