http://qs321.pair.com?node_id=128929

When posting a Code fragment, one is presented with a TEXTAREA labeled "Code", which might lead one to believe that it suffices to merely paste in a code fragment. Alas, fragments do in fact require <CODE> tags, but once you post, you can't edit the node. Aaaargh!

I suggest that either <CODE> tags be inserted automagically if needed, or that the text area be labeled

Code (please remember to add <CODE> tags)

I'd be surpised if this hasn't been mentioned before.

  • Comment on Auto CODE tags when posting Code examples?

Replies are listed 'Best First'.
Re: Auto CODE tags when posting Code examples?
by rob_au (Abbot) on Dec 02, 2001 at 05:11 UTC
    I have thought about requesting the same feature previously but realised that some authors who had to post multiple code fragments to explain their code would be disadvantaged by this approach. In this instance, instead of having the ability to space and title code fragments accordingly, the entire section would appear as one long block of code instead of separate parts. The change in title however is an excellent suggestion.

    You should however be able to edit the node - If you go to your node, there should be a small "edit your code here" underneath the table border around your code block.

     

    perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'

Re: Auto CODE tags when posting Code examples?
by grinder (Bishop) on Dec 03, 2001 at 02:46 UTC
    The other possibility being that the textarea contains <code></code> (huh, try writing that in <code> tags...) as a default value.

    I too have been bitten by this each time I have posted to the code catacombs, but if you look closely there is a link to "edit your code" somewhere on the page. That's important, because it lets people update the root node based on the feedback they get.

    --
    g r i n d e r

    just another bofh

(jcwren) Re: Auto CODE tags when posting Code examples?
by jcwren (Prior) on Dec 05, 2001 at 11:51 UTC

    Truth is, it has been mentioned several times before, but being one of the "small things", I imagine it's slipped below vrooms radar (it had been mentioned in passing conversations, not a formal request)

    In any case, I've submitted a couple of patches to preload the textarea with <CODE> and </CODE> tags in both Craft and Code. Snippets already supports it.

    --Chris

    e-mail jcwren