? ?‍? ?‍? Highlighting B4X code in HTML pages using Prism

Erel

B4X founder
Staff member
Licensed User
Longtime User
Example: https://www.b4x.com/js/

Prism is a popular JavaScript text highlighter: https://prismjs.com/index.html

It is the same library that is installed in the forum and highlights the code.
The B4X rules and a modified CSS file are attached.

Note that it is not 100% perfect due to it being a context free parser, overall it does a good job and the code looks much better than plain text.
 

Attachments

  • prism.zip
    9.1 KB · Views: 533
Last edited:

ilan

Expert
Licensed User
Longtime User

Erel

B4X founder
Staff member
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…