PHPackages                             club-1/flarum-ext-server-side-highlight - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. club-1/flarum-ext-server-side-highlight

ActiveFlarum-extension[Utility &amp; Helpers](/categories/utility)

club-1/flarum-ext-server-side-highlight
=======================================

Server-side code highlighting with cached results.

v1.4.0(3y ago)2620↓56.3%[3 issues](https://github.com/club-1/flarum-ext-server-side-highlight/issues)[1 PRs](https://github.com/club-1/flarum-ext-server-side-highlight/pulls)AGPL-3.0-or-laterPHPPHP &gt;=7.3CI passing

Since Apr 25Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/club-1/flarum-ext-server-side-highlight)[ Packagist](https://packagist.org/packages/club-1/flarum-ext-server-side-highlight)[ GitHub Sponsors](https://github.com/sponsors/n-peugnet)[ RSS](/packages/club-1-flarum-ext-server-side-highlight/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (7)Versions (14)Used By (0)

CLUB1 Server Side Highlight
===========================

[](#club1-server-side-highlight)

[![License](https://camo.githubusercontent.com/398898b5adf87bbb4595fa050c0881480ef4bdfb0dd23527fb62ba4ea29c6717/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4147504c2d2d332e302d2d6f722d2d6c617465722d626c75652e737667)](https://camo.githubusercontent.com/398898b5adf87bbb4595fa050c0881480ef4bdfb0dd23527fb62ba4ea29c6717/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4147504c2d2d332e302d2d6f722d2d6c617465722d626c75652e737667) [![Latest Stable Version](https://camo.githubusercontent.com/645906c31e3b96748d62a06aa91482d4e6f37256749e01944ab426b74b2a115e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c75622d312f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742e737667)](https://packagist.org/packages/club-1/flarum-ext-server-side-highlight) [![Total Downloads](https://camo.githubusercontent.com/3d56a22b21cbdd603e40b3a1b68e0bc330dba47cba874840d9f9cd426ae592e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c75622d312f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742e737667)](https://packagist.org/packages/club-1/flarum-ext-server-side-highlight) [![Coverage](https://camo.githubusercontent.com/07eb40c35f3876075148c64d98d3718944c4d097e80873f685b109d2986ce46d/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f636c75622d312f666c6172756d2d6578742d7365727665722d736964652d686967686c696768743f746f6b656e3d55505959484f54415744)](https://codecov.io/gh/club-1/flarum-ext-server-side-highlight) [![Build Status](https://camo.githubusercontent.com/ba7074a8e3111ec3703a8e464df944ccc21e149bd5ef6fc54e2bb0e23c140dc1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636c75622d312f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742f636865636b2e796d6c3f6272616e63683d6d61696e)](https://github.com/club-1/flarum-ext-server-side-highlight/actions/workflows/check.yml)

A [Flarum](http://flarum.org) extension. Server-side code highlighting with cached results.

[![banner](https://camo.githubusercontent.com/4d063832772faf6bfc26b632c2c44715e561e306cdad89af5131d853fee5b755/68747470733a2f2f7374617469632e636c7562312e66722f6e69636f6c61732f70726f6a656374732f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742f62616e6e65722e706e67)](https://camo.githubusercontent.com/4d063832772faf6bfc26b632c2c44715e561e306cdad89af5131d853fee5b755/68747470733a2f2f7374617469632e636c7562312e66722f6e69636f6c61732f70726f6a656374732f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742f62616e6e65722e706e67)[![banner](https://camo.githubusercontent.com/a34d0770106c556f79961e39804dbcc0ddd0d7d345240977e7f1f1ecaac4ca76/68747470733a2f2f7374617469632e636c7562312e66722f6e69636f6c61732f70726f6a656374732f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742f73657474696e67732e706e67)](https://camo.githubusercontent.com/a34d0770106c556f79961e39804dbcc0ddd0d7d345240977e7f1f1ecaac4ca76/68747470733a2f2f7374617469632e636c7562312e66722f6e69636f6c61732f70726f6a656374732f666c6172756d2d6578742d7365727665722d736964652d686967686c696768742f73657474696e67732e706e67)

For each code block of the posts, a hash is computed while parsing them, then on render the code highlighting is done in the backend once, and stored in the cache for future renderings.

It provides the following advantages:

1. The highlighting is done on the server so it is not up to the clients to do it.
2. The server uses the cache to save highlighted blocks to only do the processing once.
3. It works without any JS so even on the worst web browser the highlight will be there and there is no delay before the highlighting is applied.
4. The theme adapts itself to the "dark mode" setting of Flarum.
5. It works even with BBCode extension disabled.
6. Admins can choose the highlight theme for both "Light" and "Dark" Flarum variants.
7. Admins can download highlight themes with `highlight:download` [Flarum console](https://docs.flarum.org/console/) command.
8. It is compatible with [`fof/nightmode`](https://github.com/FriendsOfFlarum/nightmode) by switching the highlight theme accordingly.

Client-side highlighting is still used, but only for the post preview.

Installation
------------

[](#installation)

Install with composer:

```
composer require club-1/flarum-ext-server-side-highlight:"*"
```

### Recommendation

[](#recommendation)

This extension alone does not apply the formatting changes to previously posted comments. I you want to reparse all the comments posts of the database it is recommended to install and enable the [`club-1/flarum-ext-chore-commands`](https://github.com/club-1/flarum-ext-chore-commands) extension and use its `chore:reparse` command.

Updating
--------

[](#updating)

```
composer update club-1/flarum-ext-server-side-highlight:"*"
php flarum migrate
php flarum cache:clear
php flarum assets:publish
```

Acknowledgement
---------------

[](#acknowledgement)

This extension is based on the following libraries:

- [highlight.php](https://github.com/scrivo/highlight.php)

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/club-1/flarum-ext-server-side-highlight)
- [GitHub](https://github.com/club-1/flarum-ext-server-side-highlight)
- [Discuss](https://discuss.flarum.org/d/32811)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance28

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

11

Last Release

1121d ago

Major Versions

v0.2.3 → v1.0.02023-04-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/23519418?v=4)[Nicolas Peugnet](/maintainers/n-peugnet)[@n-peugnet](https://github.com/n-peugnet)

---

Top Contributors

[![n-peugnet](https://avatars.githubusercontent.com/u/23519418?v=4)](https://github.com/n-peugnet "n-peugnet (87 commits)")

---

Tags

flarumflarum-extensionhighlightphpflarum

### Embed Badge

![Health badge](/badges/club-1-flarum-ext-server-side-highlight/health.svg)

```
[![Health](https://phpackages.com/badges/club-1-flarum-ext-server-side-highlight/health.svg)](https://phpackages.com/packages/club-1-flarum-ext-server-side-highlight)
```

###  Alternatives

[flarum-lang/russian

Russian language pack for Flarum.

12128.3k](/packages/flarum-lang-russian)[fof/byobu

Well integrated, advanced private discussions.

59120.6k13](/packages/fof-byobu)[fof/discussion-language

Specify the language a discussion is written in &amp; sort by language

1034.8k4](/packages/fof-discussion-language)[flarum-lang/french

French language pack to localize the Flarum forum software plus its official and third-party extensions.

1938.7k](/packages/flarum-lang-french)[fof/gamification

Upvotes and downvotes for your Flarum community

4066.1k8](/packages/fof-gamification)[fof/best-answer

Mark a post as the best answer in a discussion

25154.0k20](/packages/fof-best-answer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
