league / commonmark-ext-strikethrough
Strikethrough support for the PHP League's CommonMark Markdown parser
Fund package maintenance!
Patreon
Installs: 63 968
Dependents: 0
Suggesters: 0
Security: 0
Stars: 6
Watchers: 4
Forks: 0
Open Issues: 0
Type:commonmark-extension
Requires
- php: ^7.1
- ext-mbstring: *
- league/commonmark: ^1.3
Requires (Dev)
- phpunit/phpunit: ^7.5
Replaces
- uafrica/commonmark-ext: >=0.1.1
This package is auto-updated.
Last update: 2020-04-04 15:35:04 UTC
README
This extension adds strikethrough Markdown support for the league/commonmark PHP Markdown parsing engine, which itself is based on the CommonMark spec.
It allows users to use ~~
in order to indicate text that should be rendered within <del>
tags.
Installation
This project can be installed via Composer:
$ composer require league/commonmark-ext-strikethrough
Usage
Extensions can be added to any new Environment
:
use League\CommonMark\CommonMarkConverter; use League\CommonMark\Environment; use League\CommonMark\Ext\Strikethrough\StrikethroughExtension; // Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go $environment = Environment::createCommonMarkEnvironment(); // Add this extension $environment->addExtension(new StrikethroughExtension()); // Instantiate the converter engine and start converting some Markdown! $converter = new CommonMarkConverter($config, $environment); echo $converter->convertToHtml('This extension is ~~good~~ great!');
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email colinodell@gmail.com instead of using the issue tracker.
Credits
License
This library is licensed under the MIT license. See the LICENSE
file for more information.