code display feature for askme September 17, 2005 6:31 AM   Subscribe

"Code" feature for ask.mefa? Not particular important or anything, but I've seen this a few times -- any attempt to post code into ask.mefi means that it'll lose its formatting.
posted by ph00dz to Feature Requests at 6:31 AM (12 comments total)

The pre tag works. I think tt, as well.
10 For J = 1 to 10020 ? "Hello World" : Next J
posted by loquacious at 7:10 AM on September 17, 2005


Does
    pre
       preserve
white
     space
          ?
posted by Armitage Shanks at 7:28 AM on September 17, 2005


Hmmm, yes, but it adds extra lines.
posted by Armitage Shanks at 7:29 AM on September 17, 2005


youhavetouse<br>
posted by grouse at 7:33 AM on September 17, 2005


Side note: the abbreviation Mefa is an anagram for FEMA.
posted by weston at 7:41 AM on September 17, 2005


umm... i meant "particularly" above. Now you can see what makes me such an excellent coder...

Anyway, maybe it's just a matter of changing the pre stylesheet definition or whatever. I don't think we need, like, full-blown colored text source views or anything like that...
posted by ph00dz at 8:06 AM on September 17, 2005


Use pastebin.
posted by monju_bosatsu at 8:57 AM on September 17, 2005


I could have used the <pre> tag, but I seriously stressed out and didn't think the nesting was that complicated, no branching just a few simple if-statements, two lines that were at the second level of nesting. I guess it looked kind of ugly. Ah well.

(and actualy didn't didn't think the problem would be solved anyway...)

I could also have used &nbsp; to indent.

I'll do that if I have another coding question. Hopefully I can stop using that god-awful programming language as soon as possible, so it won't be a problem.
posted by delmoi at 11:22 AM on September 17, 2005


umm... i meant "particularly" above.

Stay away from actionscript!!! :P
posted by delmoi at 11:23 AM on September 17, 2005


I've tried to post non code with more careful formatting and run into this problem. Shouldn't pre it act like a straight text file? I think what I wanted to do was make a quick table of values, but it was so unreadable I had to give up...

Actually, now that I think about it, if you have functioning plain text there are ways to render all kinds of concepts (it is working correctly in live preview actually, lets see how a post works...):
                                   |\
       R1                          |  \
in ---/\/\/\---o------o-----o------|amp >------ out
               |      |     |      |  /
               \     --    --      |/
               /     \/    /\
               \     --    --
            R2 /      | D1  | D2
               |      |     |
              ---    ---   ---
posted by Chuckles at 1:32 PM on September 17, 2005


                                   |\       R1                          |  \in ---/\/\/\---o------o-----o------|amp >------ out               |      |     |      |  /               \     --    --      |/               /     \/    /\               \     --    --            R2 /      | D1  | D2               |      |     |              ---    ---   ---
You have to run it all on one line, separated by br's. Yuk.
posted by blag at 8:15 AM on September 18, 2005


Chance of ASCII goatse man sightings: HIGH!
posted by shepd at 9:27 AM on September 19, 2005


« Older Ask MeFi made Business Week's Best of the Web list...   |   NYC Meetup Newer »

You are not logged in, either login or create an account to post comments