{"id":13409913,"url":"https://github.com/erusev/parsedown","last_synced_at":"2025-05-12T18:16:49.103Z","repository":{"id":432200,"uuid":"11323319","full_name":"erusev/parsedown","owner":"erusev","description":"Better Markdown Parser in PHP","archived":false,"fork":false,"pushed_at":"2024-12-01T16:36:17.000Z","size":1523,"stargazers_count":14894,"open_issues_count":180,"forks_count":1140,"subscribers_count":213,"default_branch":"master","last_synced_at":"2025-05-12T18:16:36.890Z","etag":null,"topics":["markdown","markdown-parser","parser","php"],"latest_commit_sha":null,"homepage":"https://parsedown.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erusev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-10T20:23:25.000Z","updated_at":"2025-05-12T10:11:42.000Z","dependencies_parsed_at":"2023-01-13T10:17:58.438Z","dependency_job_id":"2cbec44d-9520-4f60-9fd4-d4cea497a093","html_url":"https://github.com/erusev/parsedown","commit_stats":{"total_commits":733,"total_committers":46,"mean_commits":"15.934782608695652","dds":0.4747612551159618,"last_synced_commit":"582f9f9cd12a894a0901bef1652854a3c5a1d874"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erusev%2Fparsedown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erusev%2Fparsedown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erusev%2Fparsedown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erusev%2Fparsedown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erusev","download_url":"https://codeload.github.com/erusev/parsedown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253795162,"owners_count":21965488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["markdown","markdown-parser","parser","php"],"created_at":"2024-07-30T20:01:04.024Z","updated_at":"2025-05-12T18:16:48.863Z","avatar_url":"https://github.com/erusev.png","language":"PHP","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=528P3NZQMP8N2"],"categories":["PHP","Markdown parser","标记","Bibliotecas","目录","Table of Contents","类库","Libraries","后端开发框架及项目","Markup","📌 Covered Topics","标记( Markup )","标记 Markup"],"sub_categories":["标记和CSS Markup and CSS","Markup and CSS","Markdown","PHP","PHP开发","Useful Packages","Markup","Globalization"],"readme":"# Parsedown\n\n[![Total Downloads](https://poser.pugx.org/erusev/parsedown/d/total.svg)](https://packagist.org/packages/erusev/parsedown)\n[![Version](https://poser.pugx.org/erusev/parsedown/v/stable.svg)](https://packagist.org/packages/erusev/parsedown)\n[![License](https://poser.pugx.org/erusev/parsedown/license.svg)](https://packagist.org/packages/erusev/parsedown)\n\nBetter Markdown Parser in PHP — \u003ca href=\"https://parsedown.org/demo\"\u003edemo\u003c/a\u003e\n\n## Features\n\n* One File\n* No Dependencies\n* [Super Fast](http://parsedown.org/speed)\n* Extensible\n* [GitHub flavored](https://github.github.com/gfm)\n* [Tested](http://parsedown.org/tests/) in 5.3 to 7.3\n* [Markdown Extra extension](https://github.com/erusev/parsedown-extra)\n\n## Installation\n\nInstall the [composer package]:\n\n    composer require erusev/parsedown\n\nOr download the [latest release] and include `Parsedown.php`\n\n[composer package]: https://packagist.org/packages/erusev/parsedown \"The Parsedown package on packagist.org\"\n[latest release]: https://github.com/erusev/parsedown/releases/latest \"The latest release of Parsedown\"\n\n## Example\n\n```php\n$Parsedown = new Parsedown();\n\necho $Parsedown-\u003etext('Hello _Parsedown_!'); # prints: \u003cp\u003eHello \u003cem\u003eParsedown\u003c/em\u003e!\u003c/p\u003e\n```\n\nYou can also parse inline markdown only:\n\n```php\necho $Parsedown-\u003eline('Hello _Parsedown_!'); # prints: Hello \u003cem\u003eParsedown\u003c/em\u003e!\n```\n\nMore examples in [the wiki](https://github.com/erusev/parsedown/wiki/) and in [this video tutorial](http://youtu.be/wYZBY8DEikI).\n\n## Security\n\nParsedown is capable of escaping user-input within the HTML that it generates. Additionally Parsedown will apply sanitisation to additional scripting vectors (such as scripting link destinations) that are introduced by the markdown syntax itself.\n\nTo tell Parsedown that it is processing untrusted user-input, use the following:\n\n```php\n$Parsedown-\u003esetSafeMode(true);\n```\n\nIf instead, you wish to allow HTML within untrusted user-input, but still want output to be free from XSS it is recommended that you make use of a HTML sanitiser that allows HTML tags to be whitelisted, like [HTML Purifier](http://htmlpurifier.org/).\n\nIn both cases you should strongly consider employing defence-in-depth measures, like [deploying a Content-Security-Policy](https://scotthelme.co.uk/content-security-policy-an-introduction/) (a browser security feature) so that your page is likely to be safe even if an attacker finds a vulnerability in one of the first lines of defence above.\n\nSafe mode does not necessarily yield safe results when using extensions to Parsedown. Extensions should be evaluated on their own to determine their specific safety against XSS.\n\n## Escaping HTML\n\n\u003e WARNING: This method is not safe from XSS!\n\nIf you wish to escape HTML in trusted input, you can use the following:\n\n```php\n$Parsedown-\u003esetMarkupEscaped(true);\n```\n\nBeware that this still allows users to insert unsafe scripting vectors, ex: `[xss](javascript:alert%281%29)`.\n\n## Questions\n\n**How does Parsedown work?**\n\nIt tries to read Markdown like a human. First, it looks at the lines. It’s interested in how the lines start. This helps it recognise blocks. It knows, for example, that if a line starts with a `-` then perhaps it belongs to a list. Once it recognises the blocks, it continues to the content. As it reads, it watches out for special characters. This helps it recognise inline elements (or inlines).\n\nWe call this approach \"line based\". We believe that Parsedown is the first Markdown parser to use it. Since the release of Parsedown, other developers have used the same approach to develop other Markdown parsers in PHP and in other languages.\n\n**Is it compliant with CommonMark?**\n\nIt passes most of the CommonMark tests. Most of the tests that don't pass deal with cases that are quite uncommon. Still, as CommonMark matures, compliance should improve.\n\n**Who uses it?**\n\n[Laravel Framework](https://laravel.com/), [Bolt CMS](http://bolt.cm/), [Grav CMS](http://getgrav.org/), [Herbie CMS](http://www.getherbie.org/), [Kirby CMS](http://getkirby.com/), [October CMS](http://octobercms.com/), [Pico CMS](http://picocms.org), [Statamic CMS](http://www.statamic.com/), [phpDocumentor](http://www.phpdoc.org/), [RaspberryPi.org](http://www.raspberrypi.org/), [Symfony Demo](https://github.com/symfony/demo) and [more](https://packagist.org/packages/erusev/parsedown/dependents).\n\n**How can I help?**\n\nUse it, star it, share it and if you feel generous, [donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=528P3NZQMP8N2).\n\n**What else should I know?**\n\nI also make [Nota](https://nota.md/) — a notes app designed for local Markdown files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferusev%2Fparsedown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferusev%2Fparsedown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferusev%2Fparsedown/lists"}