{"id":13681397,"url":"https://github.com/mecoepcoo/easy-markdown","last_synced_at":"2025-04-30T03:31:19.257Z","repository":{"id":97018074,"uuid":"89139424","full_name":"mecoepcoo/easy-markdown","owner":"mecoepcoo","description":"一个简单的markdown解析器，能够将markdown解析为html。项目主要用于入门学习，使用最基本的正则表达式来解析并处理文本，而不是常规的AST方法。","archived":false,"fork":false,"pushed_at":"2017-08-22T05:42:36.000Z","size":39,"stargazers_count":37,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-12T00:36:39.573Z","etag":null,"topics":["markdown","markdown-parser","markdown-to-html","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/mecoepcoo.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,"publiccode":null,"codemeta":null}},"created_at":"2017-04-23T12:16:40.000Z","updated_at":"2024-08-26T10:27:23.000Z","dependencies_parsed_at":"2023-05-02T04:23:56.298Z","dependency_job_id":null,"html_url":"https://github.com/mecoepcoo/easy-markdown","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mecoepcoo%2Feasy-markdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mecoepcoo%2Feasy-markdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mecoepcoo%2Feasy-markdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mecoepcoo%2Feasy-markdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mecoepcoo","download_url":"https://codeload.github.com/mecoepcoo/easy-markdown/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251635212,"owners_count":21619171,"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","markdown-to-html","typescript"],"created_at":"2024-08-02T13:01:30.276Z","updated_at":"2025-04-30T03:31:19.018Z","avatar_url":"https://github.com/mecoepcoo.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# easy-markdown\n\n\u003e 极致简单的markdown编辑器，\u003ca href=\"https://mecoepcoo.github.io/easy-markdown/demo.html\" style=\"color: #ff5858;\"\u003e查看DEMO\u003c/a\u003e\n\n# 安装\n如果仅使用easy-markdown的解析功能，只需下载`/dist/easy-markdown.min.js`，否则应该下载dist中的全部文件。\n\n# 使用\neasy-markdown基于原生js开发，无需任何依赖，在页面中引入：\n```html\n\u003cscript src=\"easy-markdown.min.js\"\u003e\u003c/script\u003e\n```\n使用**默认样式**：\n```html\n\u003clink rel=\"stylesheet\" href=\"easy-markdown.min.css\"\u003e\n```\n要使用代码高亮，可以配合**highlight.js**使用：\n```html\n\u003clink rel=\"stylesheet\" href=\"//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/styles/default.min.css\"\u003e\n\u003cscript src=\"//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.11.0/highlight.min.js\"\u003e\u003c/script\u003e\n```\nhighlight.js文档：[https://highlightjs.org/usage/](https://highlightjs.org/usage/)\n\n使用解释器：\n```html\n\u003ctextarea id=\"mark\"\u003e\u003c/textarea\u003e\n\u003cdiv id=\"preview\"\u003e\u003c/div\u003e\n```\n```javascript\nwindow.onload = function () {\n    var markdown = new Reader(\"mark\");\n    //获取原始文本\n    markdown.reader;\n    //获取转义后的原始文本\n    markdown.readerTransfer;\n    //以数组形式获得所有文本\n    markdown.getHtml();\n    //渲染文本到页面元素\n    markdown.showHtml(\"preview\");\n    //获取指定行文本(示例为第0行)\n    markdown.getLineText(0);\n    //获取编辑器分组后的原始文本\n    markdown.getLines();\n};\n```\n\n监听键盘事件实现实时解析：\n```javascript\ndocument.getElementById(\"mark\").addEventListener(\"keyup\", function () {\n    var markdown = new Reader(\"mark\");\n    markdown.showHtml(\"preview\");\n});\n```\n\n# 效果预览\n标题：\n# 标题1\n## 标题2\n### 标题3\n#### 标题4\n##### 标题5\n###### 标题6\n\n分割线：\n---\n\n区块引用：\n\u003e helloworld\n\n列表：\n- 无序列表\n- 无序列表\n- 无序列表\n\n1. 有序列表\n1. 有序列表\n1. 有序列表\n\n代码块：\n```javascript\nvar x = \"helloworld\";\n```\n\n```html\n\u003cscript\u003e\n    var x = \"helloworld\";\n\u003c/script\u003e\n```\n\n其他：\n\n[超链接](https://mecoepcoo.github.io/easy-markdown/demo.html)\n\n**粗体**，*斜体*，`代码行`\n\n图片：\n![图片](./lib/demo.jpg)\n\n解析器也支持原生的html语法。\n\n# 许可证\nCopyright (c) 2017, Tianzhen(340349237@qq.com). (MIT License).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmecoepcoo%2Feasy-markdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmecoepcoo%2Feasy-markdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmecoepcoo%2Feasy-markdown/lists"}