ows / commonmark-sup-sub-extensions
A sup/sub extension for CommonMark PHP implementation
Installs: 7 688
Dependents: 1
Suggesters: 0
Security: 0
Stars: 9
Watchers: 11
Forks: 6
Open Issues: 6
Type:commonmark-extension
Requires
- league/commonmark: ^1.0
Requires (Dev)
- phpstan/phpstan-shim: ^0.11.16
- phpunit/phpunit: ^7.5
README
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());
Syntax
Code:
10^2^ 10~2~
Result:
10<sup>2</sup> 10<sub>2</sub>