[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-8587":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":17,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},8587,"commonmark","thephpleague\u002Fcommonmark","thephpleague","Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.","https:\u002F\u002Fcommonmark.thephpleague.com",null,"PHP",2955,209,34,22,0,1,7,60.17,"BSD 3-Clause \"New\" or \"Revised\" License",false,"2.8",true,[5,25,26,27,28,29],"gfm","github-flavored-markdown","hacktoberfest","markdown","php","2026-06-12 04:00:40","# league\u002Fcommonmark\n\n[![Latest Version](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fleague\u002Fcommonmark.svg?style=flat-square)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fleague\u002Fcommonmark)\n[![Total Downloads](https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdt\u002Fleague\u002Fcommonmark.svg?style=flat-square)](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fleague\u002Fcommonmark)\n[![Software License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-BSD--3-brightgreen.svg?style=flat-square)](LICENSE)\n[![Build Status](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Factions\u002Fworkflow\u002Fstatus\u002Fthephpleague\u002Fcommonmark\u002Ftests.yml?branch=main&style=flat-square)](https:\u002F\u002Fgithub.com\u002Fthephpleague\u002Fcommonmark\u002Factions?query=workflow%3ATests+branch%3Amain)\n[![Coverage Status](https:\u002F\u002Fimg.shields.io\u002Fscrutinizer\u002Fcoverage\u002Fg\u002Fthephpleague\u002Fcommonmark.svg?style=flat-square)](https:\u002F\u002Fscrutinizer-ci.com\u002Fg\u002Fthephpleague\u002Fcommonmark\u002Fcode-structure)\n[![Quality Score](https:\u002F\u002Fimg.shields.io\u002Fscrutinizer\u002Fg\u002Fthephpleague\u002Fcommonmark.svg?style=flat-square)](https:\u002F\u002Fscrutinizer-ci.com\u002Fg\u002Fthephpleague\u002Fcommonmark)\n[![Psalm Type Coverage](https:\u002F\u002Fshepherd.dev\u002Fgithub\u002Fthephpleague\u002Fcommonmark\u002Fcoverage.svg)](https:\u002F\u002Fshepherd.dev\u002Fgithub\u002Fthephpleague\u002Fcommonmark)\n[![CII Best Practices](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F126\u002Fbadge)](https:\u002F\u002Fbestpractices.coreinfrastructure.org\u002Fprojects\u002F126)\n[![Sponsor development of this project](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fsponsor%20this%20package-%E2%9D%A4-ff69b4.svg?style=flat-square)](https:\u002F\u002Fwww.colinodell.com\u002Fsponsor)\n\n![league\u002Fcommonmark](commonmark-banner.png)\n\n**league\u002Fcommonmark** is a highly-extensible PHP Markdown parser created by [Colin O'Dell][@colinodell] which supports the full [CommonMark] spec and [GitHub-Flavored Markdown].  It is based on the [CommonMark JS reference implementation][commonmark.js] by [John MacFarlane] \\([@jgm]\\).\n\n## 📦 Installation & Basic Usage\n\nThis project requires PHP 7.4 or higher with the `mbstring` extension.  To install it via [Composer] simply run:\n\n``` bash\n$ composer require league\u002Fcommonmark\n```\n\nThe `CommonMarkConverter` class provides a simple wrapper for converting CommonMark to HTML:\n\n```php\nuse League\\CommonMark\\CommonMarkConverter;\n\n$converter = new CommonMarkConverter([\n    'html_input' => 'strip',\n    'allow_unsafe_links' => false,\n]);\n\necho $converter->convert('# Hello World!');\n\n\u002F\u002F \u003Ch1>Hello World!\u003C\u002Fh1>\n```\n\nOr if you want GitHub-Flavored Markdown, use the `GithubFlavoredMarkdownConverter` class instead:\n\n```php\nuse League\\CommonMark\\GithubFlavoredMarkdownConverter;\n\n$converter = new GithubFlavoredMarkdownConverter([\n    'html_input' => 'strip',\n    'allow_unsafe_links' => false,\n]);\n\necho $converter->convert('# Hello World!');\n\n\u002F\u002F \u003Ch1>Hello World!\u003C\u002Fh1>\n```\n\nPlease note that only UTF-8 and ASCII encodings are supported.  If your Markdown uses a different encoding please convert it to UTF-8 before running it through this library.\n\n> [!CAUTION]\n> If you will be parsing untrusted input from users, please consider setting the `html_input` and `allow_unsafe_links` options per the example above. See \u003Chttps:\u002F\u002Fcommonmark.thephpleague.com\u002Fsecurity\u002F> for more details. If you also do choose to allow raw HTML input from untrusted users, consider using a library (like [HTML Purifier](https:\u002F\u002Fgithub.com\u002Fezyang\u002Fhtmlpurifier)) to provide additional HTML filtering.\n\n## 📓 Documentation\n\nFull documentation on advanced usage, configuration, and customization can be found at [commonmark.thephpleague.com][docs].\n\n## ⏫ Upgrading\n\nInformation on how to upgrade to newer versions of this library can be found at \u003Chttps:\u002F\u002Fcommonmark.thephpleague.com\u002Freleases>.\n\n## 💻 GitHub-Flavored Markdown\n\nThe `GithubFlavoredMarkdownConverter` shown earlier is a drop-in replacement for the `CommonMarkConverter` which adds additional features found in the GFM spec:\n\n - Autolinks\n - Disallowed raw HTML\n - Strikethrough\n - Tables\n - Task Lists\n\nSee the [Extensions documentation](https:\u002F\u002Fcommonmark.thephpleague.com\u002Fcustomization\u002Fextensions\u002F) for more details on how to include only certain GFM features if you don't want them all.\n\n## 🗃️ Related Packages\n\n### Integrations\n\n- [CakePHP 3](https:\u002F\u002Fgithub.com\u002Fgourmet\u002Fcommon-mark)\n- [Drupal](https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fmarkdown)\n- [Laravel 4+](https:\u002F\u002Fgithub.com\u002FGrahamCampbell\u002FLaravel-Markdown)\n- [Sculpin](https:\u002F\u002Fgithub.com\u002Fbcremer\u002Fsculpin-commonmark-bundle)\n- [Symfony 2 & 3](https:\u002F\u002Fgithub.com\u002Fwebuni\u002Fcommonmark-bundle)\n- [Symfony 4](https:\u002F\u002Fgithub.com\u002Favensome\u002Fcommonmark-bundle)\n- [Twig Markdown extension](https:\u002F\u002Fgithub.com\u002Ftwigphp\u002Fmarkdown-extension)\n- [Twig filter and tag](https:\u002F\u002Fgithub.com\u002Faptoma\u002Ftwig-markdown)\n- [Laravel CommonMark Blog](https:\u002F\u002Fgithub.com\u002Fspekulatius\u002Flaravel-commonmark-blog)\n\n### Included Extensions\n\nSee [our extension documentation](https:\u002F\u002Fcommonmark.thephpleague.com\u002Fextensions\u002Foverview) for a full list of extensions bundled with this library.\n\n### Community Extensions\n\nCustom parsers\u002Frenderers can be bundled into extensions which extend CommonMark.  Here are some that you may find interesting:\n\n - [Emoji extension](https:\u002F\u002Fgithub.com\u002FElGigi\u002FCommonMarkEmoji) - UTF-8 emoji extension with Github tag.\n - [Sup Sub extensions](https:\u002F\u002Fgithub.com\u002FOWS\u002Fcommonmark-sup-sub-extensions) - Adds support of superscript and subscript (`\u003Csup>` and `\u003Csub>` HTML tags).\n - [YouTube iframe extension](https:\u002F\u002Fgithub.com\u002Fzoonru\u002Fcommonmark-ext-youtube-iframe) - Replaces youtube link with iframe.\n - [Lazy Image extension](https:\u002F\u002Fgithub.com\u002Fsimonvomeyser\u002Fcommonmark-ext-lazy-image) - Adds various options for lazy loading of images.\n - [Marker Extension](https:\u002F\u002Fgithub.com\u002Fnoah1400\u002Fcommonmark-marker-extension) - Adds support of highlighted text (`\u003Cmark>` HTML tag).\n - [Pygments Highlighter extension](https:\u002F\u002Fgithub.com\u002FDanielEScherzer\u002Fcommonmark-ext-pygments-highlighter) - Adds support for highlighting code with the Pygments library.\n - [LatexRenderer extension](https:\u002F\u002Fgithub.com\u002Fsamwilson\u002Fcommonmark-latex) - For rendering Markdown to LaTeX.\n\nOthers can be found on [Packagist under the `commonmark-extension` package type](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fleague\u002Fcommonmark?type=commonmark-extension).\n\nIf you build your own, feel free to submit a PR to add it to this list!\n\n### Others\n\nCheck out the other cool things people are doing with `league\u002Fcommonmark`: \u003Chttps:\u002F\u002Fpackagist.org\u002Fpackages\u002Fleague\u002Fcommonmark\u002Fdependents>\n\n## 🏷️ Versioning\n\n[SemVer](http:\u002F\u002Fsemver.org\u002F) is followed closely. Minor and patch releases should not introduce breaking changes to the codebase; however, they might change the resulting AST or HTML output of parsed Markdown (due to bug fixes, spec changes, etc.)  As a result, you might get slightly different HTML, but any custom code built onto this library should still function correctly.\n\nAny classes or methods marked `@internal` are not intended for use outside of this library and are subject to breaking changes at any time, so please avoid using them.\n\n## 🛠️ Maintenance & Support\n\nWhen a new **minor** version (e.g. `2.0` -> `2.1`) is released, the previous one (`2.0`) will continue to receive security and critical bug fixes for *at least* 3 months.\n\nWhen a new **major** version is released (e.g. `1.6` -> `2.0`), the previous one (`1.6`) will receive critical bug fixes for *at least* 3 months and security updates for 6 months after that new release comes out.\n\n(This policy may change in the future and exceptions may be made on a case-by-case basis.)\n\n**Professional support, including notification of new releases and security updates, is available through a [Tidelift Subscription](https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Fpackagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme).**\n\n## 👷‍♀️ Contributing\n\nTo report a security vulnerability, please use the [Tidelift security contact](https:\u002F\u002Ftidelift.com\u002Fsecurity). Tidelift will coordinate the fix and disclosure with us.\n\nIf you encounter a bug in the spec, please report it to the [CommonMark] project.  Any resulting fix will eventually be implemented in this project as well.\n\nContributions to this library are **welcome**, especially ones that:\n\n * Improve usability or flexibility without compromising our ability to adhere to the [CommonMark spec]\n * Mirror fixes made to the [reference implementation][commonmark.js]\n * Optimize performance\n * Fix issues with adhering to the [CommonMark spec]\n\nMajor refactoring to core parsing logic should be avoided if possible so that we can easily follow updates made to [the reference implementation][commonmark.js]. That being said, we will absolutely consider changes which don't deviate too far from the reference spec or which are favored by other popular CommonMark implementations.\n\nPlease see [CONTRIBUTING](https:\u002F\u002Fgithub.com\u002Fthephpleague\u002Fcommonmark\u002Fblob\u002Fmain\u002F.github\u002FCONTRIBUTING.md) for additional details.\n\n## 🧪 Testing\n\n``` bash\n$ composer test\n```\n\nThis will also test league\u002Fcommonmark against the latest supported spec.\n\n## 🚀 Performance Benchmarks\n\nYou can compare the performance of **league\u002Fcommonmark** to other popular parsers by running the included benchmark tool:\n\n``` bash\n$ .\u002Ftests\u002Fbenchmark\u002Fbenchmark.php\n```\n\n## 👥 Credits & Acknowledgements\n\nThis code was originally based on the [CommonMark JS reference implementation][commonmark.js] which is written, maintained, and copyrighted by [John MacFarlane].  This project simply wouldn't exist without his work.\n\nAnd a huge thanks to all of our amazing contributors:\n\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fthephpleague\u002Fcommonmark\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src=\"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=thephpleague\u002Fcommonmark\" \u002F>\n\u003C\u002Fa>\n\n### Sponsors\n\nWe'd also like to extend our sincere thanks the following sponsors who support ongoing development of this project:\n\n - [Tidelift](https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Fpackagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme) for offering support to both the maintainers and end-users through their [professional support](https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Fpackagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme) program\n - [Blackfire](https:\u002F\u002Fwww.blackfire.io\u002F) for providing an Open-Source Profiler subscription\n - [JetBrains](https:\u002F\u002Fwww.jetbrains.com\u002F) for supporting this project with complimentary [PhpStorm](https:\u002F\u002Fwww.jetbrains.com\u002Fphpstorm\u002F) licenses\n\nAre you interested in sponsoring development of this project? See \u003Chttps:\u002F\u002Fwww.colinodell.com\u002Fsponsor> for a list of ways to contribute.\n\n## 📄 License\n\n**league\u002Fcommonmark** is licensed under the BSD-3 license.  See the [`LICENSE`](LICENSE) file for more details.\n\n## 🏛️ Governance\n\nThis project is primarily maintained by [Colin O'Dell][@colinodell].  Members of the [PHP League] Leadership Team may occasionally assist with some of these duties.\n\n## 🗺️  Who Uses It?\n\nThis project is used by [Drupal](https:\u002F\u002Fwww.drupal.org\u002Fproject\u002Fmarkdown), [Laravel Framework](https:\u002F\u002Flaravel.com\u002F), [Cachet](https:\u002F\u002Fcachethq.io\u002F), [Firefly III](https:\u002F\u002Ffirefly-iii.org\u002F), [Neos](https:\u002F\u002Fwww.neos.io\u002F), [Daux.io](https:\u002F\u002Fdaux.io\u002F), and [more](https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fleague\u002Fcommonmark\u002Fdependents)!\n\n---\n\n\u003Cdiv align=\"center\">\n\t\u003Cb>\n\t\t\u003Ca href=\"https:\u002F\u002Ftidelift.com\u002Fsubscription\u002Fpkg\u002Fpackagist-league-commonmark?utm_source=packagist-league-commonmark&utm_medium=referral&utm_campaign=readme\">Get professional support for league\u002Fcommonmark with a Tidelift subscription\u003C\u002Fa>\n\t\u003C\u002Fb>\n\t\u003Cbr>\n\t\u003Csub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies\u003Cbr>assurances about security, maintenance, and licensing for their dependencies.\n\t\u003C\u002Fsub>\n\u003C\u002Fdiv>\n\n[CommonMark]: http:\u002F\u002Fcommonmark.org\u002F\n[CommonMark spec]: http:\u002F\u002Fspec.commonmark.org\u002F\n[commonmark.js]: https:\u002F\u002Fgithub.com\u002Fjgm\u002Fcommonmark.js\n[GitHub-Flavored Markdown]: https:\u002F\u002Fgithub.github.com\u002Fgfm\u002F\n[John MacFarlane]: http:\u002F\u002Fjohnmacfarlane.net\n[docs]: https:\u002F\u002Fcommonmark.thephpleague.com\u002F\n[docs-examples]: https:\u002F\u002Fcommonmark.thephpleague.com\u002Fcustomization\u002Foverview\u002F#examples\n[docs-example-twitter]: https:\u002F\u002Fcommonmark.thephpleague.com\u002Fcustomization\u002Finline-parsing#example-1---twitter-handles\n[docs-example-smilies]: https:\u002F\u002Fcommonmark.thephpleague.com\u002Fcustomization\u002Finline-parsing#example-2---emoticons\n[All Contributors]: https:\u002F\u002Fgithub.com\u002Fthephpleague\u002Fcommonmark\u002Fcontributors\n[@colinodell]: https:\u002F\u002Fwww.twitter.com\u002Fcolinodell\n[@jgm]: https:\u002F\u002Fgithub.com\u002Fjgm\n[jgm\u002Fstmd]: https:\u002F\u002Fgithub.com\u002Fjgm\u002Fstmd\n[Composer]: https:\u002F\u002Fgetcomposer.org\u002F\n[PHP League]: https:\u002F\u002Fthephpleague.com\n","league\u002Fcommonmark 是一个高度可扩展的 PHP Markdown 解析器，完全支持 CommonMark 和 GitHub-Flavored Markdown 规范。该项目基于 John MacFarlane 的 CommonMark JS 参考实现，并提供了 `CommonMarkConverter` 和 `GithubFlavoredMarkdownConverter` 两个核心类来实现 Markdown 到 HTML 的转换。它允许开发者通过配置选项来控制解析行为，如移除 HTML 输入和禁止不安全链接等，从而确保在处理用户输入时的安全性。适用于需要将 Markdown 格式文本转换为 HTML 的各种 Web 应用场景，尤其是那些需要兼容 GitHub 风格 Markdown 的项目。",2,"2026-06-11 03:18:43","top_language"]