Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
1.10 Change Code BB Tag
#1
Thumbs Up 
Hi,

Remove code and php tag.

Add code=lang tag and any code colorant. (Prism or highlight.js)

Example

For HTML (xxx = code):

[xxx=html]your code here[/xxx]

Output (Source Code)

<pre><code>your code here</code></pre>

I believe this is necessary.

Thx.
Reply
#2
I don't really think that this is necessary or something important but ok...
MyBB Translator & helper
Please do not PM me requesting free support or help for your forums.
You can see my paid services here.
Reply
#3
I think details are important Sad
Reply
#4
I want to say that this is not necessary for most of forums and it would be real pain to make that different for each language or so and even than not all languages will be implemented as there are too much of them so...

Maybe it's not something necessary right now.
MyBB Translator & helper
Please do not PM me requesting free support or help for your forums.
You can see my paid services here.
Reply
#5
Considering that MyBB already has support for PHP syntax highlighting, it probably won't hurt adding that for every other language. If I recall, the 2.0 parser had support for Markdown, which in Discord would be:

```php
...PHP code here...
```

Edit: I got tripped up by the names Discourse and Discord being similar again x.x
Reply
#6
(2017-12-09, 03:18 AM)Azah Wrote: Considering that MyBB already has support for PHP syntax highlighting, it probably won't hurt adding that for every other language.
Actually the reason it's there is likely because PHP syntax highlighting is included in PHP itself.
Other languages would require someone to actually write a parser, which may introduce speed issues and the like.
Reply
#7
Yeah, we could do the syntax highlighting with JS, but then when users have JS disabled obviously that won't work. Whether that's an acceptable trade-off, I'm not sure.
Reply
#8
There is another thread about highlighting code syntax. Code is complex enough it would require a full-blown plugin / parser instead of a simple REGEX / replace custom MyCode. I don't know if enough forums post code to make code block a standard MyCode. Also, as I mentioned in that other thread, use GeSHi to highlight the syntax on the server side instead of relying on complex JavaScript.
Reply
#9
I thought this was a way to edit the 'CODe' text above the source code box, i've been looking for a way to do this for some time... I want to change the 'Quote' and 'Code' text to-:

Quote = 'Highlighted Text'
&
Code = 'Links'

Can someone tell me which file these parts of the code are in please?
(FYI : I can see when i look at the 'inspect' part of Firefox it is a label called 'codeblock' so i guess this is just the html/css for the 'code' and 'quote' boxes)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)