Additional language for [code=...] bbcode

Additional language for [code=...] bbcode

CMTV

Well-known member
Great tutorial. This will be handy as i want to add latex and c++ to my site.
Questions.
How come latex does not render and just color? Im using mathjax js to render them.
What do i need to do to get the code bbcode to default to c++ and the rest needs to specify?
 
What do i need to do to get the code bbcode to default to c++ and the rest needs to specify?
Great question. Added a new section to the guide.

How come latex does not render and just color? Im using mathjax js to render them.
I guess you need to prohibit MathJax to render LaTeX code in pre.bbCodeCode code elements. This can be done vie configuration .js file.
 
Thanks for the great guide. We are probably among few that use latex.
I guess you need to prohibit MathJax to render LaTeX code in pre.bbCodeCode code elements. This can be done vie configuration .js file.
Just to clarify, I have mathjax on XF 1.5 and plan to remove them when moving to XF 2. i have a test site with xf2 and try to see how it will render. It appears from your example that prism will not render latex. Can you confirm?
 
It seems you are right. MathJax do not touch the code inside pre code elements. No need to edit it's config file!
math_jax_code.webp
 
MathJax renders math: LaTeX code -> Fancy math
PrismJS simply highlights the code (including LaTeX code). No render work. It serves a different purpose.
 
To get started with FoxPro highlighting, I took the PrismJS file for QuickBasic, renamed it and changed the header and footer to say foxpro instead of visualbasic. After installation, I am getting coloring.

Next step is to look at translating the json file or the xml file for the other coloring system that was designed specifically for FoxPro into a JavaScript file for PrismJS. That other system is called Sublime. I have an experienced JavaScript programmer at work I will ask about this translation effort. Since my work and forum are all about translation efforts, this is very doable. There are free translators online that may help in this. Will see what the js guy says.
 
Yes but I no longer use the addon corresponding to this tips. But I remember it worked great, I just followed the guide step by step.
 
I can't for the life of me get this to work? Checked bunch of times so I'm sure I've done it correctly. Could it be just doesn't work in Xenforo anymore?

Just to update - I thought I wasn't able to get the plugin to work, but I just figured out it's working, it's just the prism highlighting for the program language I'm using is very basic.
 
Last edited:
Back
Top Bottom