Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

RE: Automatic CODE tags

by jjhorner (Hermit)
on Jun 20, 2000 at 16:50 UTC ( #18992=note: print w/ replies, xml ) Need Help??

in reply to Automatic CODE tags

Another solution would be to look for the hash-bang line that would seem to denote the start of code, then collect it and everything up to and including the last semi-colon, and wrap in code tags. Not a perfect solution, and I'm not sure how feasible (what with everyone having different hash-bang lines and all), but a possible solution.

We could just make everything in the text box preformatted with a PRE tag. That wouldn't be a perfect solution either, but still a possible solution.


use warnings;
use strict;

#testing pre and code


After seeing kudra's response, it shouldn't be that hard to run a regexp against everyone's post (non-greedy) to be able to split up code and text. Having two code blocks could be as easy as a good rexexp.

J. J. Horner
Linux, Perl, Apache, Stronghold, Unix

Comment on RE: Automatic CODE tags
Replies are listed 'Best First'.
RE: RE: Automatic CODE tags
by dempa (Friar) on Jun 20, 2000 at 16:54 UTC
    Why not just put a big All code should be inside <code></code> tags! on the edit page? I know it's a bit naive to assume that everyone who comes here can read, but anyway... :)
      I think that their should be some help at the top of the postings area. You could even have it only pop up when is user is below a level. Cuz I am pretty sure most people once they get to level 2 or so know how to do it. Also they could put the <code> put code here </code> inside of the text area that we have to put data into.
      <TEXTAREA WRAP=VIRTUAL NAME="reply" ROWS=10 COLS=60> <CODE>put code here&lt;/CODE> </TEXTAREA>

      Maybe even put the code tags into the text area so that all they have to do is get the insertion point in the right place. I suppose it is all a matter of getting the balance right -easy for first timers but without annoying the more experienced users.

      I think there is an assumption that people are comfortable with this type of HTMLish structure that perhaps has never been challenged.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://18992]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-11-28 16:40 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (743 votes), past polls