Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Auto CODE tags when posting Code examples?

by dws (Chancellor)
on Dec 02, 2001 at 03:28 UTC ( #128929=monkdiscuss: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://128929]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2021-09-25 01:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?