Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

What's the best BBCode for inline code snippets?


  • Please log in to reply
2 replies to this topic

#1 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer


  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:11:46 PM

Posted 02 December 2012 - 02:01 AM

On StackOverflow, backticks (`) are used to indicate that a section of text is to be formatted as code, inline with text. Example:

When you call foo() in bar(int) it throws EXCEPTION_ACCESS_VIOLATION.

I wrote the above paragraph as
foo() in bar(int) it throws EXCEPTION_ACCESS_VIOLATION. _linenums:0'>When you call foo() in bar(int) it throws EXCEPTION_ACCESS_VIOLATION.
because BBCode doesn't have an inline code construct. (code and codebox constructs are block constructs; not inline constructs)

I'd like to get an example like the above as close as possible to what the forum software does for a code or codebox block inline. What is the best way to accomplish that?

Billy3

Edited by Billy O'Neal, 02 December 2012 - 02:17 AM.

Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image

BC AdBot (Login to Remove)

 


#2 Blade

Blade

    Strong in the Bleepforce


  • Site Admin
  • 12,702 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:US
  • Local time:02:46 AM

Posted 02 December 2012 - 02:55 AM

Unfortunately I don't believe our BBCode parser currently has that functionality built into it. I know some other forums have added that functionality though, so perhaps there is a chance that could be added sometime in the future.

Really the best way I can come up with to do it as of now is with a font set tag, as you did.

Sorry I couldn't be of more help.

Posted Image

If I am helping you, it has been 48 hours since your last post, and I have yet to reply to your topic, please send me a PM
Become a BleepingComputer fan: Facebook
Follow us on Twitter!
Circle us on Google+


#3 Billy O'Neal

Billy O'Neal

    Visual C++ STL Maintainer

  • Topic Starter

  • Malware Response Team
  • 12,304 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Redmond, Washington
  • Local time:11:46 PM

Posted 02 December 2012 - 03:18 AM

Yeah -- I'm not looking for a specific tag. More for the best workaround. E.g. possible tags other than font (background? color?) to make something appear more "code-like".

Billy3
Twitter - My statements do not establish the official position of Microsoft Corporation, and are my own personal opinion. (But you already knew that, right?)
Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users