{"id":16622014,"url":"https://github.com/itzderock/discord-markdown-parser","last_synced_at":"2025-04-06T06:06:54.941Z","repository":{"id":59551940,"uuid":"537858460","full_name":"ItzDerock/discord-markdown-parser","owner":"ItzDerock","description":"A library to parse discord style markdown into an abstract syntax tree.","archived":false,"fork":false,"pushed_at":"2025-03-23T20:21:20.000Z","size":136,"stargazers_count":30,"open_issues_count":3,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T05:04:17.812Z","etag":null,"topics":["discord","hacktoberfest","markdown","parse","parser"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ItzDerock.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-17T15:58:51.000Z","updated_at":"2025-03-23T20:21:20.000Z","dependencies_parsed_at":"2025-01-20T22:22:40.654Z","dependency_job_id":"0bed522e-8847-4ed2-8c0f-ff2c68bc817f","html_url":"https://github.com/ItzDerock/discord-markdown-parser","commit_stats":{"total_commits":20,"total_committers":3,"mean_commits":6.666666666666667,"dds":0.35,"last_synced_commit":"4ba18e31b32890f364566d6a7ceffede1249996e"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-markdown-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-markdown-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-markdown-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ItzDerock%2Fdiscord-markdown-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ItzDerock","download_url":"https://codeload.github.com/ItzDerock/discord-markdown-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441044,"owners_count":20939239,"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":["discord","hacktoberfest","markdown","parse","parser"],"created_at":"2024-10-12T02:49:10.618Z","updated_at":"2025-04-06T06:06:54.919Z","avatar_url":"https://github.com/ItzDerock.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `discord-markdown-parser`\n\n[![Discord](https://img.shields.io/discord/555474311637499955?label=discord)](https://discord.gg/rf5qN7C)\n[![npm](https://img.shields.io/npm/dw/discord-markdown-parser)](http://npmjs.org/package/discord-markdown-parser)\n![GitHub package.json version](https://img.shields.io/github/package-json/v/ItzDerock/discord-markdown-parser)\n![GitHub Repo stars](https://img.shields.io/github/stars/ItzDerock/discord-markdown-parser?style=social)\n\nA node.js markdown implementation based on the [simple-markdown](https://github.com/Khan/simple-markdown) library, which is the same technology [discord use](https://discord.com/blog/how-discord-renders-rich-messages-on-the-android-app).\n\nDesigned to be used for [discord-html-transcripts](https://github.com/ItzDerock/discord-html-transcripts)\n\n`discord-markdown-parser` will parse any given string into an [AST tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree) and supports:\n\n-   links\n-   block quotes\n-   inline quotes\n-   code blocks\n-   inline code\n-   italics (em)\n-   spoilers\n-   timestamps\n-   bold\n-   strikethrough\n-   underline\n-   channel mentions\n-   user mentions\n-   role mentions\n-   @everyone\n-   @here\n-   emojis\n-   slash command mentions\n-   guild navigation mentions\n-   \u0026 more\n\n## Usage\n\n```js\nimport { parse } from 'discord-markdown-parser';\n// or const { parse } = require('discord-markdown-parser');\n\n// input is a string\nconst input = 'test **markdown** with `cool` *stuff*';\n\n// specify what type of markdown this is\n// this can be 'normal' or 'extended' (default = normal)\n// extended should be used if the input is from a webhook message or embed description.\nconst type = 'normal';\n\n// will return an AST tree\nconst parsed = parse(input, type);\n```\n\n## Extending\n\n```js\n// you can import the default rules using\nimport { rules } from 'discord-markdown-parser';\n\n// and you can add your own rules\nconst newRules = {\n    ...rules,\n    customRule: {\n        ...\n    } // see simple-markdown documentation for details\n};\n\n// import simpleMarkdown\nimport SimpleMarkdown from '@khanacademy/simple-markdown';\n\n// and create the parser\nconst parser = SimpleMarkdown.parserFor(newRules);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzderock%2Fdiscord-markdown-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzderock%2Fdiscord-markdown-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzderock%2Fdiscord-markdown-parser/lists"}