PK d‘„PȹB¬f f
CONDUCT.mdnu W+A„¶ # Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)
PK d‘„PŒDšì .travis.ymlnu W+A„¶ language: php
dist: bionic
php:
- 7.1
- 7.2
- 7.3
- 7.4
env:
matrix:
- COMPOSER_FLAGS=""
- COMPOSER_FLAGS="--prefer-stable --prefer-lowest"
install:
- travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source
script:
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
after_script:
- wget https://github.com/scrutinizer-ci/ocular/releases/download/1.5.2/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
PK d‘„PÀ¢l!§ § README.mdnu W+A„¶ # league/commonmark-extras
[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-downloads]
## DEPRECATED
**This extension has been deprecated**. All of its functionality now exists in [`league/commonmark`][link-league-commonmark] 1.3+. You can either register the various extensions individually or use the `GithubFlavoredMarkdownExtension` to get full GFM functionality, so you should upgrade to that version of `league/commonmark` and use that instead of this one.
## Overview
**league/commonmark-extras** is a collection of useful GFM extensions and utilities
for the [league/commonmark][link-league-commonmark] project.
Adding this extension to your project will automatically register these sub-extensions:
| **Extension** | **Purpose** |
| :------------ | :---------- |
| [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 |
| [league/commonmark-ext-table](https://github.com/thephpleague/commonmark-ext-table) | GFM-style tables |
| [league/commonmark-ext-task-list](https://github.com/thephpleague/commonmark-ext-task-list) | GFM-style task lists `- [x] Like this` |
## Install
Via Composer
``` bash
$ composer require league/commonmark-extras
```
## Usage
This can be added to any new `Environment`:
``` php
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Extras\CommonMarkExtrasExtension;
// Obtain a pre-configured Environment with all the CommonMark parsers/renderers ready-to-go
$environment = Environment::createCommonMarkEnvironment();
// REGISTER THIS EXTENSION HERE
$environment->addExtension(new CommonMarkExtrasExtension());
// 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](CHANGELOG.md) for more information what has changed recently.
## Testing
``` bash
$ composer test
```
## Security
If you discover any security related issues, please email colinodell@gmail.com instead of using the issue tracker.
## Credits
- [Colin O'Dell][link-author]
- [All Contributors][link-contributors]
## License
This library is licensed under the BSD-3 license. See the [LICENSE file](LICENSE) for more information.
[ico-version]: https://img.shields.io/packagist/v/league/commonmark-extras.svg?style=flat-square
[ico-license]: http://img.shields.io/badge/License-BSD--3-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/thephpleague/commonmark-extras/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/thephpleague/commonmark-extras.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/thephpleague/commonmark-extras.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/league/commonmark-extras.svg?style=flat-square
[link-packagist]: https://packagist.org/packages/league/commonmark-extras
[link-travis]: https://travis-ci.org/thephpleague/commonmark-extras
[link-scrutinizer]: https://scrutinizer-ci.com/g/thephpleague/commonmark-extras/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/thephpleague/commonmark-extras
[link-downloads]: https://packagist.org/packages/league/commonmark-extras
[link-author]: https://github.com/colinodell
[link-contributors]: ../../contributors
[link-league-commonmark]: https://github.com/thephpleague/commonmark
PK d‘„P¬Ò€x CONTRIBUTING.mdnu W+A„¶ # Contributing
Contributions are **welcome** and will be fully **credited**.
We accept contributions via Pull Requests on [Github](https://github.com/thephpleague/commonmark-extras).
## New Extensions & Features
New extensions and features will only be considered if they meet all of the following criteria:
1. The extension/feature is bundled as a standalone extension, preferably under the PHP League.
2. External dependencies should be avoided where possible - use plain PHP code and common extensions.
3. Contributions must have a common use case found in other flavors of Markdown like GFM which other people may find useful.
## Pull Requests
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
- **Create feature branches** - Don't ask us to pull from your master branch.
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
- **Docblocks** - All files should start with the following docblock:
~~~
/*
* This file is part of the league/commonmark-extras package.
*
* (c) Colin O'Dell
*
* Authored by Your Name
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
~~~
The "Authored by" line is optional.
## Running Tests
``` bash
$ composer test
```
**Happy coding**!
PK d‘„PŽˆA A
.gitignorenu W+A„¶ /.idea/
/build/
composer.lock
composer.phar
/vendor/
phpunit.xml
PK d‘„P¼J¬w w ! src/CommonMarkExtrasExtension.phpnu W+A„¶
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace League\CommonMark\Extras;
use League\CommonMark\ConfigurableEnvironmentInterface;
use League\CommonMark\Extension\Autolink\AutolinkExtension;
use League\CommonMark\Extension\GithubFlavoredMarkdownExtension;
use League\CommonMark\Extension\SmartPunct\SmartPunctExtension;
use League\CommonMark\Extension\Strikethrough\StrikethroughExtension;
use League\CommonMark\Extension\Table\TableExtension;
use League\CommonMark\Extension\TaskList\TaskListExtension;
use League\CommonMark\Extension\ExtensionInterface;
/**
* @deprecated The league/commonmark-extras extension is now deprecated. All functionality has been moved into league/commonmark 1.3+, so use that instead.
*/
final class CommonMarkExtrasExtension implements ExtensionInterface
{
public function __construct()
{
@trigger_error(sprintf('league/commonmark-extras is deprecated; use individual extensions or %s from league/commonmark 1.3+ instead', GithubFlavoredMarkdownExtension::class), E_USER_DEPRECATED);
}
public function register(ConfigurableEnvironmentInterface $environment)
{
$environment->addExtension(new AutolinkExtension());
$environment->addExtension(new SmartPunctExtension());
$environment->addExtension(new StrikethroughExtension());
$environment->addExtension(new TableExtension());
$environment->addExtension(new TaskListExtension());
}
}
PK d‘„PlÝV`' ' .github/FUNDING.ymlnu W+A„¶ github: colinodell
patreon: colinodell
PK d‘„PºÅ·¿· · .github/stale.ymlnu W+A„¶ # Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 21
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- on hold
- security
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
PK d‘„P'פ]‚ ‚ .styleci.ymlnu W+A„¶ preset: recommended
enabled:
- concat_with_spaces
- strict
disabled:
- concat_without_spaces
- phpdoc_short_description
PK d‘„PÑë
‹ ‹ .gitattributesnu W+A„¶ # Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
# Ignore all test and documentation with "export-ignore".
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/scrutinizer.yml export-ignore
/tests export-ignore
PK d‘„P÷†Ai? ? phpunit.xml.distnu W+A„¶
tests
src
PK d‘„P%.ÁÚ8 8
.editorconfignu W+A„¶ ; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
PK d‘„P+™ñ[e e CHANGELOG.mdnu W+A„¶ # Changelog
All Notable changes to `commonmark-extras` will be documented in this file
## [Unreleased][unreleased]
## [1.2.0] - 2020-04-04
### Deprecated
**This extension has been deprecated**. All of its functionality now exists in league/commonmark 1.3+ as `GithubFlavoredMarkdownExtension`.
## [1.1.0] - 2019-07-13
### Added
- Added table parsing functionality via [league/commonmark-ext-table v2.0.0](https://github.com/thephpleague/commonmark-ext-table/releases/tag/v2.0.0)
## [1.0.0] - 2019-06-29
No changes have been introduced since 1.0.0-beta2.
## [1.0.0-beta2] - 2019-06-05
### Changed
- Made this extension compatible with `league/commonmark` 1.0.0-beta4
## [1.0.0-beta1] - 2019-05-27
### Changed
- Made this extension compatible with `league/commonmark` 1.0.0-beta1
## [0.5.0] - 2019-05-12
### Added
- Added GFM-style task list support via [league/commonmark-ext-task-list v0.1.0](https://github.com/thephpleague/commonmark-ext-task-list/releases/tag/v0.1.0)
## [0.4.0] - 2019-04-19
### 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
- Made this extension compatible with `league/commonmark` 0.19
## [0.2.1] - 2019-03-16
### Added
- Added support for [league/commonmark-ext-autolink v0.2.0](https://github.com/thephpleague/commonmark-ext-autolink/releases/tag/v0.2.0)
## [0.2.0] - 2019-03-14
**All previous functionality has been removed and placed into separate packages!** This library now serves as a meta-package to pull in officially-recommended extensions.
### Added
- Added [league/commonmark-ext-autolink](https://github.com/thephpleague/commonmark-ext-autolink) and [league/commonmark-ext-smartpunct](https://github.com/thephpleague/commonmark-ext-smartpunct) as dependencies
- Added `CommonMarkExtrasExtension` to pull in both of the libraries above
### Changed
- Moved SmartPunct into its own package:
- Moved the Twitter handle parsing into its own package:
- Bumped the minimum PHP version up to 5.6
- Bumped the minimum [league/commonmark](https://github.com/thephpleague/commonmark) version to 0.18.1
### Removed
- Removed all classes implementing SmartPunct and Twitter handle parsing as those now live elsewhere
- Removed support for PHP 5.4, PHP 5.5, and HHVM
## [0.1.5] - 2018-09-28
### Changed
- Added league/commonmark 0.18 as a compatible version
## [0.1.4] - 2017-12-31
### Changed
- Added league/commonmark 0.17 as a compatible version
## [0.1.3] - 2017-10-30
### Changed
- Added league/commonmark 0.16 as a compatible version
- Bumped target spec to 0.28 (no code changes required)
## [0.1.2] - 2016-09-19
### Changed
- Added league/commonmark 0.14 and 0.15 as compatible versions
- Bumped target spec to 0.26 (no code changes required)
## [0.1.1] - 2016-01-16
### Fixed
- Fixed incorrect usage example in the README (#5)
## 0.1.0 - 2016-01-13
### Added
- Created this new library
- Added the SmartPunct functionality from the league/commonmark project
- Added the Twitter handle autolinker example from the league/commonmark docs site (#1)
### Changed
- Minor refactoring to SmartPunct's `QuoteParser` to reduce complexity
[unreleased]: https://github.com/thephpleague/commonmark-extras/compare/1.2.0...HEAD
[1.2.0]: https://github.com/thephpleague/commonmark-extras/compare/1.1.0...1.2.0
[1.1.0]: https://github.com/thephpleague/commonmark-extras/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/thephpleague/commonmark-extras/compare/1.0.0-beta2...1.0.0
[1.0.0-beta2]: https://github.com/thephpleague/commonmark-extras/compare/1.0.0-beta1...1.0.0-beta2
[1.0.0-beta1]: https://github.com/thephpleague/commonmark-extras/compare/0.5.0...1.0.0-beta1
[0.5.0]: https://github.com/thephpleague/commonmark-extras/compare/0.4.0...0.5.0
[0.4.0]: https://github.com/thephpleague/commonmark-extras/compare/0.3.0...0.4.0
[0.3.0]: https://github.com/thephpleague/commonmark-extras/compare/0.2.1...0.3.0
[0.2.1]: https://github.com/thephpleague/commonmark-extras/compare/0.2.0...0.2.1
[0.2.0]: https://github.com/thephpleague/commonmark-extras/compare/0.1.4...0.2.0
[0.1.5]: https://github.com/thephpleague/commonmark-extras/compare/0.1.4...0.1.5
[0.1.4]: https://github.com/thephpleague/commonmark-extras/compare/0.1.3...0.1.4
[0.1.3]: https://github.com/thephpleague/commonmark/compare/0.1.2...0.1.3
[0.1.2]: https://github.com/thephpleague/commonmark/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/thephpleague/commonmark/compare/0.1.0...0.1.1
PK d‘„PJX
' tests/CommonMarkExtrasExtensionTest.phpnu W+A„¶
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace League\CommonMark\Extras\Tests;
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment;
use League\CommonMark\Extras\CommonMarkExtrasExtension;
use PHPUnit\Framework\TestCase;
final class CommonMarkExtrasExtensionTest extends TestCase
{
public function testExtension()
{
$input = <<“You can contact the author of this project library at colinodell@gmail.com or check out his website: https://www.colinodell.comâ€
My Favorite CommonMark Parsers |
league/commonmark |
Don’t forget to:
EOT;
$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new CommonMarkExtrasExtension());
$converter = new CommonMarkConverter([], $environment);
$this->assertEquals($expected, $converter->convertToHtml($input));
}
}
PK d‘„PY3ƒi¹ ¹ .scrutinizer.ymlnu W+A„¶ filter:
excluded_paths: [tests/*]
checks:
php:
code_rating: true
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
fix_doc_comments: true
tools:
external_code_coverage:
timeout: 600
runs: 3
php_analyzer: true
php_code_coverage: false
php_code_sniffer:
config:
standard: PSR2
filter:
paths: ['src']
php_cpd:
enabled: true
excluded_dirs: [vendor, tests]
php_loc:
enabled: true
excluded_dirs: [vendor, tests]
php_pdepend: true
php_sim: true
PK d‘„P¯Ïîsí í LICENSEnu W+A„¶ BSD 3-Clause License
Copyright (c) 2014-2019, Colin O'Dell
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PK d‘„PƶY Y
composer.jsonnu W+A„¶ {
"name": "league/commonmark-extras",
"type": "commonmark-extension",
"description": "Useful extensions for customizing the league/commonmark Markdown parser",
"keywords": ["markdown", "commonmark", "extensions", "extras", "gfm"],
"homepage": "https://github.com/thephpleague/commonmark-extras",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Colin O'Dell",
"email": "colinodell@gmail.com",
"homepage": "https://www.colinodell.com",
"role": "Lead Developer"
}
],
"require": {
"php" : "^7.1",
"league/commonmark": "^1.3"
},
"require-dev": {
"phpunit/phpunit" : "^7.5"
},
"autoload": {
"psr-4": {
"League\\CommonMark\\Extras\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"league\\CommonMark\\Extras\\Test\\": "tests"
}
},
"scripts": {
"test": "phpunit"
},
"extra": {
"branch-alias": {
"dev-master": "1.3-dev"
}
},
"abandoned": "league/commonmark"
}
PK d‘„PȹB¬f f
CONDUCT.mdnu W+A„¶ PK d‘„PŒDšì .travis.ymlnu W+A„¶ PK d‘„PÀ¢l!§ § â
README.mdnu W+A„¶ PK d‘„P¬Ò€x  CONTRIBUTING.mdnu W+A„¶ PK d‘„PŽˆA A
¡$ .gitignorenu W+A„¶ PK d‘„P¼J¬w w ! % src/CommonMarkExtrasExtension.phpnu W+A„¶ PK d‘„PlÝV`' ' ä+ .github/FUNDING.ymlnu W+A„¶ PK d‘„PºÅ·¿· · N, .github/stale.ymlnu W+A„¶ PK d‘„P'פ]‚ ‚ F/ .styleci.ymlnu W+A„¶ PK d‘„PÑë
‹ ‹ 0 .gitattributesnu W+A„¶ PK d‘„P÷†Ai? ? Í1 phpunit.xml.distnu W+A„¶ PK d‘„P%.ÁÚ8 8
L5 .editorconfignu W+A„¶ PK d‘„P+™ñ[e e Á6 CHANGELOG.mdnu W+A„¶ PK d‘„PJX
' bI tests/CommonMarkExtrasExtensionTest.phpnu W+A„¶ PK d‘„PY3ƒi¹ ¹ ÃP .scrutinizer.ymlnu W+A„¶ PK d‘„P¯Ïîsí í ¼T LICENSEnu W+A„¶ PK d‘„PƶY Y
àZ composer.jsonnu W+A„¶ PK J v_