markuplite request: some tag equivelant to < pre >
by Orion Elenzil · in Site Feedback · 04/17/2009 (3:23 pm) · 8 replies
[ code ] is pretty cool for code,
but sometimes i want a fixed-width font and literally no changes to my formatting, without all the bells -n- whistles.
(also, [ code ] changes the indenting of brackets, which thanks-for-going-to-the-trouble-but-really-please-don't-bother-,-thank-you).
so it would be cool if there were a markuplite tag, perhaps [ pre ] and [ /pre ], which just translated to html's good old < pre > and < /pre >.
thanks!
but sometimes i want a fixed-width font and literally no changes to my formatting, without all the bells -n- whistles.
(also, [ code ] changes the indenting of brackets, which thanks-for-going-to-the-trouble-but-really-please-don't-bother-,-thank-you).
so it would be cool if there were a markuplite tag, perhaps [ pre ] and [ /pre ], which just translated to html's good old < pre > and < /pre >.
thanks!
About the author
#2
in my browser, the codeblock above has six spaces in front of each line after the if() statement were not part of the post.
04/17/2009 (3:34 pm)
that's what i mean by the [ code ] tag changing the indentation.in my browser, the codeblock above has six spaces in front of each line after the if() statement were not part of the post.
#3
..why is it not letting me post this reply ? do i need a miminum number of characters ? do i need to let thirty seconds elapse ?
edit - not sure. i'm guessing the latter, as it finally let me post the reply.
04/17/2009 (3:35 pm)
"view plain" also contains the extra indentation...why is it not letting me post this reply ? do i need a miminum number of characters ? do i need to let thirty seconds elapse ?
edit - not sure. i'm guessing the latter, as it finally let me post the reply.
#4
could i also request that the default view for [ code ] blocks be "Plain", with an option for "View Fancy" ?
one problem with the fancy view is that the line numbers get included when you copy the text.
04/17/2009 (3:38 pm)
while i'm rambling,could i also request that the default view for [ code ] blocks be "Plain", with an option for "View Fancy" ?
one problem with the fancy view is that the line numbers get included when you copy the text.
#5
04/17/2009 (3:59 pm)
While I haven't noticed the extra indentation before, I have seen that copy/paste from Firefox does include the line numbers. Chrome doesn't. Didn't care to test that in IE.if (%param $= "manual")
{
echo("I manually indented this 4 spaces!");
}
else if (%param $= "autoIndent")
{
echo("Let's see if the website code block auto-indented.");
}
else
%param = "weird";
#6
funny about firefox v. chrome there.
woops, i mis-spake.
what it's actually doing is removing six spaces which are in front of the if(),
not adding them to the other lines.
here's a screencap of editing the message:
04/17/2009 (4:20 pm)
hey Michael, thanks for replying.funny about firefox v. chrome there.
woops, i mis-spake.
what it's actually doing is removing six spaces which are in front of the if(),
not adding them to the other lines.
here's a screencap of editing the message:
#7
What if you have a line return before the if and then do the spacing?
EDIT: nope, it still removes the spaces before the if.
What's even stranger about the Firefox/Chrome line number thing is that Chrome actually highlights the line #'s, Firefox doesn't yet copies them anyway.
04/17/2009 (4:44 pm)
Hmm, yeah, I have seen it remove spaces. Funny though that it doesn't remove all of them.What if you have a line return before the if and then do the spacing?
EDIT: nope, it still removes the spaces before the if.
What's even stranger about the Firefox/Chrome line number thing is that Chrome actually highlights the line #'s, Firefox doesn't yet copies them anyway.
#8
if you use ' \ 0 ' (without spaces) in the code block, the \0 is converted to an unprintable character when editing the post, and displays as a small slice of insanity when viewing the post.
especially problematic since as i'm sure you know that particular sequence of characters is quite common. yikes, the fact that when you subsequently edit the message and the content is changed sort of implies that all extant codeblocks are borked and would need some sort of migration to repair them.
04/20/2009 (11:11 am)
here's another bug in the [ code ] stuff -if you use ' \ 0 ' (without spaces) in the code block, the \0 is converted to an unprintable character when editing the post, and displays as a small slice of insanity when viewing the post.
especially problematic since as i'm sure you know that particular sequence of characters is quite common. yikes, the fact that when you subsequently edit the message and the content is changed sort of implies that all extant codeblocks are borked and would need some sort of migration to repair them.
Associate Orion Elenzil
Real Life Plus
if (argv != NULL && timeStart != 0) { U32 timeFinish = Platform::getRealMilliseconds(); U32 timeDelta = timeFinish - timeStart; }