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(2y ago)2559—0%[2 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 4mo 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 1mo ago

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

29

—

LowBetter than 60% of packages

Maintenance32

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

1069d ago

Major Versions

v0.2.3 → v1.0.02023-04-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9795ca225ea502ac9b23147fc8e47ca23e95e3e78e7ceb74b897ea6306aad19?d=identicon)[n-peugnet](/maintainers/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

[fof/byobu

Well integrated, advanced private discussions.

61105.8k9](/packages/fof-byobu)[fof/user-bio

Add a user bio to user profiles

2196.5k9](/packages/fof-user-bio)[fof/links

Manage Flarum primary navbar menu links

39118.3k2](/packages/fof-links)[fof/drafts

Allow users to create post and discussion drafts

1771.1k5](/packages/fof-drafts)[fof/nightmode

Add a Night Mode option for your users to use on your Flarum forum

3774.5k2](/packages/fof-nightmode)[fof/best-answer

Mark a post as the best answer in a discussion

26135.2k15](/packages/fof-best-answer)

PHPackages © 2026

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