Auto-detect code.

  • meman
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3432
  • Loc: London Town , Apples and pears and all that crap

Post 3+ Months Ago

I don't know how possible or difficult this would be, but it would be nice if the bbcode could auto detect when people have posted code and put in [.code] tags where appropriate.

It's no big deal, but sometimes when people post code straight into thier post it makes it hard to read, especially when there is huge chunks of it.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13502
  • Loc: Florida

Post 3+ Months Ago

Near impossible to put them in automaticly, while certain tokens could be watched for (ie functions, ect) there's no way to accurately predict where the code would begin & end.

HTML code could be easy to do, but not everyone looking for answers will be using a DOCTYPE, some will not even have open AND close HTML elements, some will just be sections of a page.
What happens when someone uses their own tag in a post ? (ie <rant>rabble rabble</rant> )

I edit posts to use code/php tags when I catch them, I grew a (what are we up to now, 10th, 11th ?) eye to keep on "reported posts", Feel free to click that little report post icon when you see any. :D
  • meman
  • Web Master
  • Web Master
  • User avatar
  • Posts: 3432
  • Loc: London Town , Apples and pears and all that crap

Post 3+ Months Ago

yeah it would be pretty hard to spot where code starts and ends in the majority of cases, but in cases where code starts <?php and ends ?> it should be pretty easy.
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I think Joebert has it pretty much right when he says "nearly impossible"

The mods that mod the programming and design boards do try to edit posts that don't contain the BBCode when we see them, but I know we miss some.

The only plausible workaround I can think of is to test for <> and if found warn the user before submitting the post that they appear to be including code and to use the BBCode, prior to submitting the post, but then they should be given the alternative to continue if they are not actually trying to post code.

Personally, I'm not certain it's worth the effort. The mods do catch a large percentage.

For example, I would have been given a warning by posting this post, even though I wasn't trying to post code because I included <> in the post.

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 4 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.