PHPackages                             mindkomm/commonmark-searchhighlight-extension - 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. [Search &amp; Filtering](/categories/search)
4. /
5. mindkomm/commonmark-searchhighlight-extension

AbandonedArchivedLibrary[Search &amp; Filtering](/categories/search)

mindkomm/commonmark-searchhighlight-extension
=============================================

Extension for CommonMark PHP implementation to highlight search strings in Markdown files

2.0.0(6y ago)418MITPHPPHP ^5.5|^7.0CI failing

Since Mar 6Pushed 6y ago2 watchersCompare

[ Source](https://github.com/mindkomm/commonmark-searchhighlight-extension)[ Packagist](https://packagist.org/packages/mindkomm/commonmark-searchhighlight-extension)[ Docs](https://github.com/mindkomm/commonmark-searchhighlight-extension)[ RSS](/packages/mindkomm-commonmark-searchhighlight-extension/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

SearchHighlight Extension
=========================

[](#searchhighlight-extension)

SearchHighlight is an extension for the [CommonMark PHP implementation](https://github.com/thephpleague/commonmark) and can be used to highlight Markdown text that matches a search string.

The extension adds a `` around the strings that match the search string.

**Example for "something":**

[![](https://cloud.githubusercontent.com/assets/2084481/23606637/e96e6b68-0261-11e7-9249-65a79a544ed7.png)](https://cloud.githubusercontent.com/assets/2084481/23606637/e96e6b68-0261-11e7-9249-65a79a544ed7.png)

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

[](#installation)

This project can be installed via [Composer](https://getcomposer.org/):

```
composer require mindkomm/commonmark-searchhighlight-extension

```

Usage
-----

[](#usage)

```
use League\CommonMark\Environment;
use League\CommonMark\CommonMarkConverter;

use Mind\CommonMark\SearchHighlightExtension\SearchHighlightExtension;

$searchstring = 'Your search string';
$config = [];

$environment = Environment::createCommonMarkEnvironment();

if (!empty($searchstring)) {
    // Pass the search string to the constructor.
    $environment->addExtension(new SearchHighlightExtension($searchstring));
}

$converter = new CommonMarkConverter($config, $environment);

echo $converter->convertToHtml('A text that contains your search string.');
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

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 ~1003 days

Total

2

Last Release

2348d ago

Major Versions

1.0.0 → 2.0.02019-12-05

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2084481?v=4)[Lukas Gächter](/maintainers/gchtr)[@gchtr](https://github.com/gchtr)

---

Top Contributors

[![gchtr](https://avatars.githubusercontent.com/u/2084481?v=4)](https://github.com/gchtr "gchtr (3 commits)")

---

Tags

commonmarkmarkdownphp-librarysearchmarkdownhighlightcommonmark

### Embed Badge

![Health badge](/badges/mindkomm-commonmark-searchhighlight-extension/health.svg)

```
[![Health](https://phpackages.com/badges/mindkomm-commonmark-searchhighlight-extension/health.svg)](https://phpackages.com/packages/mindkomm-commonmark-searchhighlight-extension)
```

###  Alternatives

[elasticsearch/elasticsearch

PHP Client for Elasticsearch

5.3k178.3M944](/packages/elasticsearch-elasticsearch)[ruflin/elastica

Elasticsearch Client

2.3k50.4M202](/packages/ruflin-elastica)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M63](/packages/graham-campbell-markdown)[solarium/solarium

PHP Solr client

93532.7M98](/packages/solarium-solarium)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[hollodotme/treemdown

A PHP class for browsing markdown files with HTML rendering, syntax highlighting and search

1440.9k3](/packages/hollodotme-treemdown)

PHPackages © 2026

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