{"id":13814978,"url":"https://github.com/segmentfault/HyperDown","last_synced_at":"2025-05-15T06:33:47.497Z","repository":{"id":36343407,"uuid":"40648138","full_name":"segmentfault/HyperDown","owner":"segmentfault","description":"一个结构清晰的，易于维护的，现代的PHP Markdown解析器","archived":false,"fork":false,"pushed_at":"2021-08-19T07:21:02.000Z","size":357,"stargazers_count":1207,"open_issues_count":22,"forks_count":221,"subscribers_count":86,"default_branch":"master","last_synced_at":"2024-10-28T17:37:40.522Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/segmentfault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-13T08:40:06.000Z","updated_at":"2024-10-19T18:49:58.000Z","dependencies_parsed_at":"2022-08-21T14:10:37.970Z","dependency_job_id":null,"html_url":"https://github.com/segmentfault/HyperDown","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentfault%2FHyperDown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentfault%2FHyperDown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentfault%2FHyperDown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segmentfault%2FHyperDown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segmentfault","download_url":"https://codeload.github.com/segmentfault/HyperDown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225335177,"owners_count":17458224,"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":[],"created_at":"2024-08-04T04:02:49.090Z","updated_at":"2024-11-19T10:30:47.804Z","avatar_url":"https://github.com/segmentfault.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"为何要写这样一个解析器\n======================\n\nMarkdown已经面世许多年了，国内外许多大大小小的网站都在用它，但是它的解析器却依然混乱不堪。SegmentFault 是中国较大规模使用 Markdown 语法的网站，我们一直在使用一些开源类库，包括但不限于\n\n1. [php-markdown](https://github.com/michelf/php-markdown)\n2. [CommonMark for PHP](https://github.com/thephpleague/commonmark)\n3. [Parsedown](https://github.com/erusev/parsedown)\n\n他们都有或多或少的毛病，有的性能较差，有的代码比较业余，更多的情况是由于Markdown本身解析比较复杂，因此我们几乎无法去维护另外一个人写的代码。基于这个原因，我为 SegmentFault 专门编写了这么一个Markdown解析器。\n\n使用方法\n--------\n\n与常规的解析类库没有任何区别\n\n```php\n$parser = new HyperDown\\Parser;\n$html = $parser-\u003emakeHtml($text);\n```\n\n当前支持的语法\n--------------\n\n- 标题\n- 列表（可递归）\n- 引用（可递归）\n- 缩进风格的代码块\n- Github风格的代码块\n- 各种行内文字加粗，斜体等效果\n- 链接，图片\n- 自动链接\n- 段内折行\n- 脚标\n- 分隔符\n- 表格\n- 图片和链接支持互相套用\n\n浏览器中使用请参阅 [HyperDown.js](https://github.com/SegmentFault/HyperDown.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegmentfault%2FHyperDown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegmentfault%2FHyperDown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegmentfault%2FHyperDown/lists"}