Support for BBcode code blocks (with syntax highlighting)?


#1

For our community code blocks with syntax highlighting are essential, but the standard Italian keyboard doesn’t have a backtick key, which Markdown requires. On Windows, we need to type ALT + 96 which is very unconvenient especially for laptop users. I tried installing the vbulletin-bbcode plugin but those don’t seem to be supported. Is it possible to add that?


(Jeff Atwood) #2

BBCode code blocks work

This is a code block using BBCode

Composed as

[code]
This is a code block using BBCode
[/code]

(Mittineague) #3

If what is already in place isn’t enough you could make a PR or plugin?

IMHO I agree with codinghorro…
Code blocks work very well.

Getting members to know how to use them might be a problem, but the solution is there


#4

You’re right, they do work, but don’t support syntax highlighting. What we previously had on myBB was

[code=cpp]
int i= 0;
i++;[/code]

Guess I’ll have to submit a plugin request then.


(Jeff Atwood) #5

Syntax highlighting is done with fenced code blocks.

https://help.github.com/articles/github-flavored-markdown/#fenced-code-blocks

You don’t have to specify the syntax, it will magically figure it out. Like so, place three backticks on the first line, and three backticks on the last line

int i= 0;
i++;

e.g.

```
int i= 0;
i++;
```

Unless you just like typing a bunch of extra stuff, or something :wink:


#6

The problem with that is Italian users can’t easily type backticks as I mentioned earlier, so I’m looking for alternatives.


(Jeff Atwood) #7

I believe there was a proposal to make the code button use backticks instead of indent, for sites that have a lot of coding.

Then they could just use the code toolbar button to insert the backticks.


#8

That’d be a great solution, is it going to be implemented at some point?


(Erlend Sogge Heggen) #9

#10

Thank you, I just noticed this setting

Now the button AND the bbcode block work the way I wanted. :smile: