Skip to content
A sup/sub extension for CommonMark PHP implementation
PHP
Branch: 2.x
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests/functional
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpstan.neon.dist
phpunit.xml.dist

README.md

ows/commonmark-sup-sub-extensions

Build Status

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

Versions compatibility

  • 2.x is compatible with league/commonmark 1.x (recommended version)
  • 1.x is compatible with league/commonmark 0.17.x and 0.18.x and will no longer be supported

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>
You can’t perform that action at this time.