{"id":18550284,"url":"https://github.com/xp-forge/markdown","last_synced_at":"2026-05-17T06:40:12.966Z","repository":{"id":8887345,"uuid":"10606003","full_name":"xp-forge/markdown","owner":"xp-forge","description":"The Markdown syntax for the XP Framework","archived":false,"fork":false,"pushed_at":"2024-04-22T15:04:22.000Z","size":359,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-15T10:09:03.177Z","etag":null,"topics":["markdown","parser","php","tree","xp-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-forge.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2013-06-10T17:44:46.000Z","updated_at":"2024-04-22T15:04:03.000Z","dependencies_parsed_at":"2024-01-09T22:39:05.664Z","dependency_job_id":"cd2ad39a-7a8e-499e-a84f-8abb421d7ce0","html_url":"https://github.com/xp-forge/markdown","commit_stats":null,"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/xp-forge/markdown","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fmarkdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fmarkdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fmarkdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fmarkdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-forge","download_url":"https://codeload.github.com/xp-forge/markdown/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fmarkdown/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260606473,"owners_count":23035350,"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","parser","php","tree","xp-framework"],"created_at":"2024-11-06T21:04:05.972Z","updated_at":"2025-10-26T01:03:21.104Z","avatar_url":"https://github.com/xp-forge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Markdown for XP Framework\n=========================\n\n[![Build status on GitHub](https://github.com/xp-forge/markdown/workflows/Tests/badge.svg)](https://github.com/xp-forge/markdown/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-forge/markdown/version.svg)](https://packagist.org/packages/xp-forge/markdown)\n\nThe [Markdown syntax](http://daringfireball.net/projects/markdown/syntax) implemented for the XP Framework.\n\nExample\n-------\nTo transform markdown to HTML, all that is necessary is the following:\n\n```php\nuse net\\daringfireball\\markdown\\Markdown;\n\n$engine= new Markdown();\n$transformed= $engine-\u003etransform(\n  'This is [Markdown](http://daringfireball.net/projects/markdown/) for **XP**'\n);\n```\n\nThe implementation is based on a parse tree. To work with the tree, you can use the `parse()` method, which returns a `net.daringfireball.markdown.ParseTree` instance.\n\n```php\nuse net\\daringfireball\\markdown\\{Markdown, ToHtml};\nuse io\\streams\\TextReader;\nuse io\\File;\n\n$engine= new Markdown();\n\n$tree= $engine-\u003eparse($markdown);\n$tree= $engine-\u003eparse(new TextReader(new File('file.md')));\n\n// ...work with tree...\n\n$transformed= $tree-\u003eemit(new ToHtml());\n```\n\nYou can control the URLs used in the `href` and `src` attributes of links and images, respectively, by using URL rewriting API:\n\n```php\nuse net\\daringfireball\\markdown\\{ToHtml, URLs, Rewriting};\n\n$emitter= new ToHtml(new URLs(Rewriting::absolute()\n  -\u003elinks('/deref?url=%s')\n  -\u003eimages('/proxy?url=\u0026s')\n  -\u003eexcluding(['localhost'])\n));\n\n$transformed= $engine-\u003etransform($markdown, [], $emitter);\n$transformed= $engine-\u003eparse($markdown)-\u003eemit($emitter);\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fmarkdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-forge%2Fmarkdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fmarkdown/lists"}