CommonMark extension for shifting heading levels by a configurable amount of levels.
composer require tuchsoft/commonmark-ext-heading-shifteruse League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use TuchSoft\CommonMarkHeadingShifter\HeadingShifterExtension;
$converter = new CommonMarkConverter([
'heading_shifter' => [
'shift_by' => 1
]
]);
$converter->getEnvironment()->addExtension(new HeadingShifterExtension());
$converter->convertToHtml("# Heading"); //<h2>Heading</h2>👤 Mattia Bonzi @ TuchSoft mattia@tuchsoft.com
- Website: tuchsoft.com
- Github: @tuchsoft
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
