makinacorpus / php-header-fixer
Fixes headers in HTML text
1.1.1
2024-01-15 16:18 UTC
Requires
- php: >=8.0
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-12-15 18:08:20 UTC
README
Header fixer
Usage
Fixes header semantic hierarchy in HTML text.
$fixedHtmlText = \MakinaCorpus\HeaderFixer\Header::fix($originalHtmlText, 0, true);
And that is pretty much it.
- Options are:
0
is the decal, if you, for example, want the text to start withh2
instead ofh1
, then set1
here, forh3
set2
, etc...true
is the relocate orphans options, if set to true, when a title is the single one at his own level, with no siblings, it will be put at a higher level side by side its parent.
TODOLIST
- implement a generic twig filter
- implement a drupal 7 module (another repo, including jolitypo)
- implement a drupal 8 module (another repo, including jolitypo)