Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 1, 2024 via composer

league/commonmark 2.2.2

Highly-extensible PHP Markdown parser which fully supports the CommonMark spec and GitHub-Flavored Markdown (GFM)
Package summary
Share
2
issues
2
high severity
license
2
3
licenses
4
MIT
2
BSD-3-Clause
2
(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)
Package created
8 Dec 2014
Version published
13 Feb 2022
Maintainers
2
Total deps
8
Direct deps
4
License
BSD-3-Clause

Issues

2

2 high severity issues

high
Recommendation: Validate that the license expression complies with your license policy
via: league/config@v1.2.0
Recommendation: Validate that the license expression complies with your license policy
via: league/config@v1.2.0
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
dflydev/dot-access-data@v3.0.2
psr/event-dispatcher@1.0.0
symfony/deprecation-contracts@v3.4.0
symfony/polyfill-php80@v1.29.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
league/commonmark@2.2.2
league/config@v1.2.0

(BSD-3-Clause OR GPL-2.0-only OR GPL-3.0-only)

Expression
2 Packages, Including:
nette/schema@v1.3.0
nette/utils@v4.0.4
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of league/commonmark 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
league/configv1.2.014.46 kBBSD-3-Clause
prod
2
psr/event-dispatcher1.0.04.17 kBMIT
prod
symfony/deprecation-contractsv3.4.03.27 kBMIT
prod
symfony/polyfill-php80v1.29.0-MIT
prod

Visualizations

Frequently Asked Questions

What does league/commonmark do?

League/commonmark is a highly extensible PHP Markdown parser. It fully supports the CommonMark specification and GitHub-Flavored Markdown. This makes it an ideal choice when you need to convert CommonMark or GitHub-Flavored Markdown into HTML. The package was created by Colin O'Dell and based on the CommonMark JS reference implementation by John MacFarlane.

How do you use league/commonmark?

To use league/commonmark in your PHP project, you first need to install it via Composer. Run the following command in your terminal:

$ composer require league/commonmark

After that, you can utilize the CommonMarkConverter or GithubFlavoredMarkdownConverter classes to convert your markdown text into HTML. Below is sample usage of the CommonMarkConverter:

use League\CommonMark\CommonMarkConverter;

$converter = new CommonMarkConverter([
    'html_input' => 'strip',
    'allow_unsafe_links' => false,
]);

echo $converter->convert('# Hello World!');

// <h1>Hello World!</h1>

If instead you want GitHub-Flavored Markdown, you can use the GithubFlavoredMarkdownConverter class:

use League\CommonMark\GithubFlavoredMarkdownConverter;

$converter = new GithubFlavoredMarkdownConverter([
    'html_input' => 'strip',
    'allow_unsafe_links' => false,
]);

echo $converter->convert('# Hello World!');

// <h1>Hello World!</h1>

Make sure to only use UTF-8 and ASCII encodings with these converters. If you're parsing untrusted input, consider setting the html_input and allow_unsafe_links options for additional security.

Where are the league/commonmark docs?

Full documentation for league/commonmark, including advanced usage, configuration, and customization information, can be found at https://commonmark.thephpleague.com. This comprehensive resource provides everything you need to unlock the full potential of the league/commonmark package.