• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Suggestion: An in-line code block

788
Posts
17
Years
  • Age 29
  • Seen today
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 [span="font-family: inconsolata; border: 1px inset; padding: 2px"]like this[/span] 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?
 
788
Posts
17
Years
  • Age 29
  • Seen today
Just bumping my old idea.

I'm not sure how difficult this would actually be to implement, or how widely used it'd end up being, but it's definitely something I would use.
 

Cherrim

PSA: Blossom Shower theme is BACK ♥
33,287
Posts
21
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.
 

Venia Silente

Inspectious. Good for napping.
1,230
Posts
15
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.
 
1,403
Posts
10
Years
  • Seen Apr 18, 2024
I can't believe I missed this! It's a huge improvement over the [span=font:monospace;background-color:silver]...[/span] I was doing before!
 
Back
Top