benfiratkaya / commonmark-ext-underline
This extension adds support for underline syntax. It allows users to use !! in order to indicate text that should be rendered within <u> tags.
Installs: 274
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:commonmark-extension
Requires
- php: ^7.4 || ^8.0
- league/commonmark: ^2.0
Requires (Dev)
- phpunit/phpunit: ^9.0
README
This extension adds support for underline syntax. It allows users to use ^^ in order to indicate text that should be rendered within tags.
Install
composer require benfiratkaya/commonmark-ext-underline
Example
use League\CommonMark\Environment\Environment; use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension; use BenFiratKaya\CommonMarkExtension\Underline; $environment = new Environment([]); $environment->addExtension(new CommonMarkCoreExtension()) ->addExtension(new UnderlineExtension()); $converter = new MarkdownConverter($environment); $html = $converter->convertToHtml('^^test^^');
This creates the following HTML
<u>test</u>