项目作者: thephpleague

项目描述 :
Strikethrough support for league/commonmark
高级语言: PHP
项目地址: git://github.com/thephpleague/commonmark-ext-strikethrough.git
创建时间: 2019-04-19T20:44:34Z
项目社区:https://github.com/thephpleague/commonmark-ext-strikethrough

开源协议:MIT License

下载


Strikethrough support for league/commonmark

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

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:

  1. $ composer require league/commonmark-ext-strikethrough

Usage

Extensions can be added to any new Environment:

  1. use League\CommonMark\CommonMarkConverter;
  2. use League\CommonMark\Environment;
  3. use League\CommonMark\Ext\Strikethrough\StrikethroughExtension;
  4. // Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go
  5. $environment = Environment::createCommonMarkEnvironment();
  6. // Add this extension
  7. $environment->addExtension(new StrikethroughExtension());
  8. // Instantiate the converter engine and start converting some Markdown!
  9. $converter = new CommonMarkConverter($config, $environment);
  10. echo $converter->convertToHtml('This extension is ~~good~~ great!');

Changelog

Please see CHANGELOG for more information what has changed recently.

Testing

  1. $ 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.