Useful extensions for the league/commonmark parser
PHP
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.editorconfig
.gitattributes
.gitignore
.scrutinizer.yml
.styleci.yml
.travis.yml
CHANGELOG.md
CONDUCT.md
CONTRIBUTING.md
LICENSE.md
README.md
composer.json
phpunit.xml.dist

README.md

league/commonmark-extras

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

league/commonmark-extras is a collection of useful extensions and utilities for the league/commonmark project.

Install

Via Composer

$ composer require league/commonmark-extras

Usage

Extensions can be added to any new Environment:

use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Extras\SmartPunct\SmartPunctExtension;

// Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go
$environment = Environment::createCommonMarkEnvironment();

// ADD YOUR OWN EXTENSIONS HERE. For example:
$environment->addExtension(new SmartPunctExtension());

// Define your configuration:
$config = [];

// Now that the `Environment` is configured we can create the converter engine:
$converter = new CommonMarkConverter($config, $environment);

// Go forth and convert you some Markdown!
echo $converter->convertToHtml('# Hello World!');

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

New features and extensions are welcome! Please see CONTRIBUTING and CONDUCT for details.

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 BSD-3 license. See the License File for more information.