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

1.0.0 2022-02-21 13:23 UTC

This package is auto-updated.

Last update: 2025-05-21 20:41:17 UTC


README

Tests

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>