Advertiser Content

Suggestion An in-line code block

Started by Zeturic November 8th, 2018 10:46 AM
  • 1572 views
  • 4 replies
Seen 5 Hours Ago
Posted 1 Week Ago
780 posts
12.9 Years
I often find myself using in-line code blocks on Discord, Github, etc. Here, [code] works fine for multiline code blocks, but if I want something in-line for use within a sentence, there isn't really any way; [code] will always introduce a line break and extend to the right edge.

You can do an approximation like this using [span], but that's not particularly convenient. I'm not suggesting that in-line code blocks have to look /exactly/ like that, it was more just showing the type of thing I'm talking about (and usage).

Would it be possible to create a new BB Code tag for this purpose?

Cherrim

Age 30
Female
Toronto
Seen 13 Hours Ago
Posted 17 Hours Ago
32,171 posts
17.2 Years
We'll probably be streamlining bb code in future versions of PC so that code will work contextually (so inline or as a separate code block depending on where the tag is used), but for now I've gone ahead and implemented this. :)

You can now use [icode]
to make text appear as code
inline with the rest of your text.


paired with erik destler.

Venia Silente

Inspectious. Good for napping.

Male
on the second floor's nest
Seen 6 Hours Ago
Posted 1 Week Ago
896 posts
11.4 Years
I was about to interject on this with some ideas and questions but since this got implemented (so soon, wow) I'm basically left speechless.

Thanks for this addition!

The only thing that I guess I might for when the future, is that I'd suggest *not* to streamline the same BBcode tag to work contextually, as there are some places where tags don't work contextually that might induce wrong parsing, or at least difficult / impossible constructs if they are nested with a tag that functions contextually. ATM the clearest example I can think of is
css-div
and
tcat
that assume the following bbcode text is parsed from the raw, meaning it is not possible to, say, leave around whitespace or blank lines for clarity without them becoming a whole new paragraph (and a corresponding <p>) in the pre-processed output.

But that's just my two cents for when then.
Venia Silente - Consulting Worldbuilder
Background... some day.
Fic stuff~

SWC Entries
: Playfield 2009 : Misaimed for Life 2014 : As They Were 2016 : Simpler than Magic 2017 : Beyond Today 2018 :

Other Releases
: Pseudo-Legendary : Silly human, romance is for Nidoran! (Valentine's : Tricks of the Love Fast (Valentine's) : Overlord (meow~) :
»»More in profile link or wiki link««

The Meta Journey!
Nidoran : Carnivine


Advertiser Content