{"id":18267669,"url":"https://github.com/oxeu/markdown","last_synced_at":"2025-04-09T02:27:24.653Z","repository":{"id":104133202,"uuid":"607533679","full_name":"OXeu/markdown","owner":"OXeu","description":"A markdown parser based on Regex and XML decoder for Kotlin Multiplatform Mobile","archived":false,"fork":false,"pushed_at":"2023-05-24T04:11:14.000Z","size":288,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T20:57:23.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","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/OXeu.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2023-02-28T06:49:50.000Z","updated_at":"2024-10-22T03:31:23.000Z","dependencies_parsed_at":"2024-03-26T08:33:35.071Z","dependency_job_id":"6f4d3770-7a67-44cd-a126-8b9fa67f8729","html_url":"https://github.com/OXeu/markdown","commit_stats":null,"previous_names":["oxeu/markdown"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fmarkdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fmarkdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fmarkdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OXeu%2Fmarkdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OXeu","download_url":"https://codeload.github.com/OXeu/markdown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247964487,"owners_count":21025201,"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-11-05T11:28:14.276Z","updated_at":"2025-04-09T02:27:24.634Z","avatar_url":"https://github.com/OXeu.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markdown 解析器\n## 实现\n### 1. Markdown to XML\n使用正则表达式将Markdown替换为XML格式的文件，可根据实际使用需求更改生成的\nXML格式\n\n具体实现文件 `MarkdownParser.kt`\n\n#### Example\n```markdown\n## Heading Atx 2\n### Heading Atx 3\n#### Heading Atx 4\n##### Heading Atx 5\n###### Heading Atx 6\n####### Heading Atx 7\n**Divider**\n-----\n__Bold___Italic_***BoldItalic***\n\u003chttps://fast.link/test\u003e\n[This is a link](https://this.is.a.link)\n![Image as this](https://img.com/test-image)\n|Table | Hello | Test|\n| ---  | ----- | ----|\n| Android|  iOS | Windows    |\n| Flyme  | MIUI | HarmonyOS  |\n| Linux  | macOS| Windows 10 |\n========\n\u003e This is a quote\n\u003e \u003e Quote in quote\n\u003e **Bold Quote***Italic* And `code` Test\n```CodeFence\nJust for fun ! Don't worry `Hello` *Italic*\n===============\n/```\n- List Test\n-  Okay\n    - Sub List\n    - Sub List 2\n  - Unnormal List\n    - [ ] Check Box\n- I'm Back\n1. Ordered List\n2. How about it\n    - Insert some thing Others\n3. Oh my gosh!I think it did not work!\n    4. Just for test,don't worry!\nAny else?\nseems nothing!\nOkay, **Run it!**\n```\n\n```xml\n\u003ch2\u003eHeading Atx 2\u003c/h2\u003e\n\u003ch3\u003eHeading Atx 3\u003c/h3\u003e\n\u003ch4\u003eHeading Atx 4\u003c/h4\u003e\n\u003ch5\u003eHeading Atx 5\u003c/h5\u003e\n\u003ch6\u003eHeading Atx 6\u003c/h6\u003e\n\u003ch6\u003eHeading Atx 7\u003c/h6\u003e\n\u003cstrong\u003eDivider\u003c/strong\u003e\n\u003cbr/\u003e\n\u003chr/\u003e\n\u003cbr/\u003e\n\u003cstrong\u003eBold\u003c/strong\u003e\u003cem\u003eItalic\u003c/em\u003e\u003cem\u003e\u003cstrong\u003eBoldItalic\u003c/strong\u003e\u003c/em\u003e\u003cbr/\u003e\n\u003ca href=\"https://fast.link/test\"\u003ehttps://fast.link/test\u003c/a\u003e\n\u003cbr/\u003e\n\u003ca href=\"https://this.is.a.link\"\u003eThis is a link\u003c/a\u003e\u003cbr/\u003e\u003cbr/\u003e\n\u003cimg src=\"https://img.com/test-image\"\u003eImage as this\u003c/img\u003e\u003cbr/\u003e\u003cbr/\u003e\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\u003cth\u003eTable\u003c/th\u003e\n            \u003cth\u003eHello\u003c/th\u003e\n            \u003cth\u003eTest\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\u003cth\u003eAndroid\u003c/th\u003e\n            \u003cth\u003eiOS\u003c/th\u003e\n            \u003cth\u003eWindows\u003c/th\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\u003cth\u003eFlyme\u003c/th\u003e\n            \u003cth\u003eMIUI\u003c/th\u003e\n            \u003cth\u003eHarmonyOS\u003c/th\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\u003cth\u003eLinux\u003c/th\u003e\n            \u003cth\u003emacOS\u003c/th\u003e\n            \u003cth\u003eWindows 10\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\u003chr/\u003e\n\u003cbr/\u003e\n\u003cblockquote\u003e This is a quote\n    \u003cbr/\u003e\n    \u003cblockquote\u003e Quote in quote\u003c/blockquote\u003e\n    \u003cstrong\u003eBold Quote\u003c/strong\u003e\u003cem\u003eItalic\u003c/em\u003e And \u003ccode\u003ecode\u003c/code\u003e Test\n\u003c/blockquote\u003e\n\u003cpre language=\"CodeFence\"\u003e\n    Just for fun ! Don't worry `Hello` *Italic*\n    ===============\n\u003c/pre\u003e\n\u003cbr/\u003e\n\u003cul\u003e\n    \u003cli\u003eList Test\u003c/li\u003e\n    \u003cli\u003eOkay\u003c/li\u003e\n    \u003cul\u003e\u003cli\u003eSub List\u003c/li\u003e\n        \u003cli\u003eSub List 2\u003c/li\u003e\n        \u003cli\u003eUnnormal List\u003c/li\u003e\n        \u003cli\u003e\u003ccheckbox checked=\"false\"\u003eCheck Box\u003c/checkbox\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n    \u003cli\u003eI'm Back\u003c/li\u003e\n\u003c/ul\u003e\n\u003col\u003e\n    \u003cli\u003eOrdered List\u003c/li\u003e\n    \u003cli\u003eHow about it\u003c/li\u003e\n\u003c/ol\u003e\n        - Insert some thing Others\u003cbr/\u003e\n\u003col\u003e\n    \u003cli\u003eOh my gosh!I think it did not work!\u003c/li\u003e\n    \u003col\u003e\n        \u003cli\u003eJust for test,don't worry!\u003c/li\u003e\n    \u003c/ol\u003e\n\u003c/ol\u003e\n        Any else?\u003cbr/\u003e\n        seems nothing!\u003cbr/\u003e\n        Okay, \u003cstrong\u003eRun it!\u003c/strong\u003e\n\u003cbr/\u003e\n```\n\n### 2. XML to AST Tree\n使用有限状态机将XML解析为可遍历的AST Tree结构  \n实现文件：`AstParser.kt`\n#### Feature  \n- 支持忽略异常闭合标签\n- 兼容未关闭标签\n- 支持属性\n- 支持无值属性，如 `\u003cinput checked/\u003e`\n- 支持自闭合标签\n#### Example\n```xml\n\u003ccenter/\u003e\n\u003cunclosed-tag\u003e\n    \u003ch1 class=1 attr=\"Hello\" checked\u003e你好\u003cp\u003eHello\u003c/p\u003e\u003c/aa\u003e\u003c/h1\u003e\n```\n\n```text\nroot(){\n    center(){},\n    unclosed-tag(){\n        h1(class =\u003e 1, attr =\u003e Hello, checked =\u003e ){\n            text(你好),\n            p(){\n                text(Hello)\n            }\n        }\n    }\n}\n```\n\n## Js使用\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxeu%2Fmarkdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foxeu%2Fmarkdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foxeu%2Fmarkdown/lists"}