Skip to content
This repository has been archived by the owner on Apr 4, 2020. It is now read-only.

Commit

Permalink
Add support for league/commonmark-ext-strikethrough v0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Apr 19, 2019
1 parent 9af6b88 commit 3a9c213
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All Notable changes to `commonmark-extras` will be documented in this file

## [Unreleased][unreleased]

### Added

- Added support for [league/commonmark-ext-strikethrough v0.4.0](https://github.com/thephpleague/commonmark-ext-strikethrough/releases/tag/v0.4.0)

## [0.3.0] - 2019-04-10

### Changed
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Adding this extension to your project will automatically register these sub-exte
| :------------ | :---------- |
| [league/commonmark-ext-autolink](https://github.com/thephpleague/commonmark-ext-autolink) | Automatically creating links to URLs and email address (without needing the `<...>` syntax) |
| [league/commonmark-ext-smartpunct](https://github.com/thephpleague/commonmark-ext-smartpunct) | Intelligently converts ASCII quotes, dashes, and ellipses to their Unicode equivalents |
| [league/commonmark-ext-strikethrough](https://github.com/thephpleague/commonmark-ext-strikethrough) | Adds support for `~~strikethrough~~` syntax |

## Install

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"php" : "^7.1",
"league/commonmark": "^0.19.1",
"league/commonmark-ext-smartpunct": "^0.2",
"league/commonmark-ext-strikethrough": "^0.4",
"league/commonmark-ext-autolink": "^0.3"
},
"require-dev": {
Expand Down
2 changes: 2 additions & 0 deletions src/CommonMarkExtrasExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
use League\CommonMark\ConfigurableEnvironmentInterface;
use League\CommonMark\Ext\Autolink\AutolinkExtension;
use League\CommonMark\Ext\SmartPunct\SmartPunctExtension;
use League\CommonMark\Ext\Strikethrough\StrikethroughExtension;
use League\CommonMark\Extension\ExtensionInterface;

final class CommonMarkExtrasExtension implements ExtensionInterface
{
public function register(ConfigurableEnvironmentInterface $environment)
{
$environment->addExtension(new SmartPunctExtension());
$environment->addExtension(new StrikethroughExtension());
$environment->addExtension(new AutolinkExtension());
}
}
4 changes: 2 additions & 2 deletions tests/CommonMarkExtrasExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ final class CommonMarkExtrasExtensionTest extends TestCase
public function testExtension()
{
$input = <<<EOT
"You can contact the author of this library at [email protected] or check out his website: https://www.colinodell.com"
"You can contact the author of this ~~project~~ library at [email protected] or check out his website: https://www.colinodell.com"
EOT;

$expected = <<<EOT
<p>“You can contact the author of this library at <a href="mailto:[email protected]">[email protected]</a> or check out his website: <a href="https://www.colinodell.com">https://www.colinodell.com</a>”</p>
<p>“You can contact the author of this <del>project</del> library at <a href="mailto:[email protected]">[email protected]</a> or check out his website: <a href="https://www.colinodell.com">https://www.colinodell.com</a>”</p>
EOT;

Expand Down

0 comments on commit 3a9c213

Please sign in to comment.