Additional Info
Package ID
First Created
February 01, 2011, 07:55:41 AM
Last Updated
March 15, 2024, 01:08:04 AM

highlight.js for SMF v1.3.3 Hooks only

Syntax highlighting in messages.
Compatible With 2.1.3, 2.1.4
Latest version v1.3.3
Downloads 4,430
Reviews 2
Rating 5/5
Subscribers 15
License BSD 3-Clause "New" or "Revised" License (View License)
This script highlights syntax in code examples on your forum.
It is very easy to use because it works automatically: finds blocks of code, detects a language, highlights it.
Supported languages: HTML/XML, Javascript, CSS, PHP, Ruby, Perl, Python, C++, C#, Java, SQL, Bash, etc.

All supported languages and styles

How to use? Very simply!

[code]your code[/code]

Advanced using

[code=language]your code[/code]

One more way

[code]your code[/code]

If you want numbering to start from some other value than 1, you can specify a numbering offset:

[code start=10]your code[/code]

  • You can choose code formatting scheme
  • You can choose font size within code blocks
  • Highlighting works automatically: finds blocks of code, detects a language, highlights it — you don't need to specify any language

Edit this CSS in /Themes/default/css/highlight.css to customize line numbers:
.hljs-ln-numbers {
    text-align: center;
    color: #f36;
    border-right: 1px solid #f36;
    vertical-align: top;
    min-width: 25px;

Available translations:
  • English
  • Russian
  • French
  • Spanish
  • German

Manual installation info
You have to register or login to be able to leave a review
Robox • September 03, 2022, 02:49:12 AM • 5/5
Works great on SMF 2.1.2, thanks a lot, it's amazing
ThomasWi • May 30, 2023, 02:18:01 PM • 5/5
Exactly what I'm looking for. This should be standard behavior for [code] blocks in SMF. I only miss the "Select" and "Expand" buttons from stock-SMF. Also it would be nice to have an option to never word-wrap long code lines but show a horizontal scroll bar instead. Update: Thanks for considering my demands. Now it's perfect for me! (Tested with SMF 2.1.3 & 2.1.4)