PHPackages                             vikpe/php-html-heading-normalizer - 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. vikpe/php-html-heading-normalizer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vikpe/php-html-heading-normalizer
=================================

PHP class for normalizing (promote/demote) HTML headings

1.1.0(9y ago)16.8k↓53.3%1[1 PRs](https://github.com/vikpe/php-html-heading-normalizer/pulls)MITPHPPHP &gt;=5.3.0

Since Jan 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/vikpe/php-html-heading-normalizer)[ Packagist](https://packagist.org/packages/vikpe/php-html-heading-normalizer)[ Docs](https://github.com/vikpe/php-html-heading-normalizer)[ RSS](/packages/vikpe-php-html-heading-normalizer/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (5)Used By (0)

PHP: HTML Heading Normalizer
============================

[](#php-html-heading-normalizer)

PHP class for normalizing (promote/demote) HTML headings.

[![Build Status](https://camo.githubusercontent.com/9b9eebbb25eee4232b91698bc422938a06c5731b3572a18c465109e6ff5dda67/68747470733a2f2f7472617669732d63692e6f72672f76696b70652f7068702d68746d6c2d68656164696e672d6e6f726d616c697a65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vikpe/php-html-heading-normalizer)[![Test Coverage](https://camo.githubusercontent.com/f380ee671a8ed4fb7a7be7b3891c8d88ef9c1f5b7d717f98221764e82ad79abc/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f76696b70652f7068702d68746d6c2d68656164696e672d6e6f726d616c697a65722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/vikpe/php-html-heading-normalizer/coverage)[![Code Climate](https://camo.githubusercontent.com/25e53cd4601e8fe8a1535f957e5916d401338378482b3c0aa5acd64b7787a0cc/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f76696b70652f7068702d68746d6c2d68656164696e672d6e6f726d616c697a65722f6261646765732f6770612e737667)](https://codeclimate.com/github/vikpe/php-html-heading-normalizer)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/a0fcbb1c58199093e5824534f45eb19989f81ddbf008a9af2e60e85eb36cb7de/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f76696b70652f7068702d68746d6c2d68656164696e672d6e6f726d616c697a65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/vikpe/php-html-heading-normalizer/?branch=master)[![StyleCI](https://camo.githubusercontent.com/ed9e4e93bb524030c992e1447cbbe8c698118daf98f5a7b95f33b027121059ed/68747470733a2f2f7374796c6563692e696f2f7265706f732f37373133393839352f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/77139895)

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

[](#installation)

```
composer require vikpe/php-html-heading-normalizer

```

Methods
-------

[](#methods)

### promote(string $html, int $numberOfLevels)

[](#promotestring-html-int-numberoflevels)

Promotes all headings in `$html` by `$numberOfLevels` levels.

```
\Vikpe\HtmlHeadingNormalizer::promote('Foo', 3); // 'Foo'
```

### demote(string $html, int $numberOfLevels)

[](#demotestring-html-int-numberoflevels)

Demotes all headings in `$html` by `$numberOfLevels` levels.

```
\Vikpe\HtmlHeadingNormalizer::demote('Foo', 1); // 'Foo'
```

### min(string $html, int $minLevel)

[](#minstring-html-int-minlevel)

Promotes/demotes all headings in `$html` so that the lowest heading level equals `$minLevel`.

```
\Vikpe\HtmlHeadingNormalizer::min('FooBar', 1); // 'FooBar'
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Total

2

Last Release

3442d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc87a50d88bb94a88806739628a89fd6d86e82ceeba1449f12b14f87b9a431ca?d=identicon)[vikpe](/maintainers/vikpe)

---

Top Contributors

[![vikpe](https://avatars.githubusercontent.com/u/1616817?v=4)](https://github.com/vikpe "vikpe (76 commits)")

---

Tags

headingshtmlphpnormalizehtmlpromoteheadingsdemote

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vikpe-php-html-heading-normalizer/health.svg)

```
[![Health](https://phpackages.com/badges/vikpe-php-html-heading-normalizer/health.svg)](https://phpackages.com/packages/vikpe-php-html-heading-normalizer)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k41.4M2.8k](/packages/ergebnis-composer-normalize)[spatie/laravel-html

A fluent html builder

8407.5M98](/packages/spatie-laravel-html)[ckeditor/ckeditor

JavaScript WYSIWYG web text editor.

5244.3M80](/packages/ckeditor-ckeditor)[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21522.3M22](/packages/caxy-php-htmldiff)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

29110.4M49](/packages/yajra-laravel-datatables-html)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3484.1M35](/packages/wa72-htmlpagedom)

PHPackages © 2026

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