A sup/sub extension for CommonMark PHP implementation
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
LICENSE
README.md
composer.json

README.md

ows/commonmark-sup-sub-extensions

This library adds support of superscript and subscript (<sup> and <sub> HTML tags) to league/commonmark.

Installation

This project can be installed via [Composer]:

$ composer require ows/commonmark-sup-sub-extensions

Usage

use League\CommonMark\Environment;
use Ows\CommonMark\SupExtension;
use Ows\CommonMark\SubExtension;

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new SupExtension());
$environment->addExtension(new SubExtension());

See CommonMark customization.

Syntax

Code:

10^2^
10~2~

Result:

10<sup>2</sup>
10<sub>2</sub>