{"id":29107724,"url":"https://github.com/fedify-dev/markdown-it-hashtag","last_synced_at":"2025-08-09T06:28:15.151Z","repository":{"id":274449120,"uuid":"805287083","full_name":"fedify-dev/markdown-it-hashtag","owner":"fedify-dev","description":"A markdown-it plugin that parses and renders Mastodon-style #hashtags","archived":false,"fork":false,"pushed_at":"2025-01-30T01:10:32.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T12:15:59.347Z","etag":null,"topics":["fediverse","hashtag","markdown","markdown-it","markdown-it-plugin"],"latest_commit_sha":null,"homepage":"https://jsr.io/@fedify/markdown-it-hashtag","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fedify-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":".github/FUNDING.yaml","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,"zenodo":null},"funding":{"open_collective":"fedify","github":"dahlia"}},"created_at":"2024-05-24T09:04:18.000Z","updated_at":"2025-01-30T03:23:26.000Z","dependencies_parsed_at":"2025-06-08T21:37:22.753Z","dependency_job_id":null,"html_url":"https://github.com/fedify-dev/markdown-it-hashtag","commit_stats":null,"previous_names":["fedify-dev/markdown-it-hashtag"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fedify-dev/markdown-it-hashtag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedify-dev%2Fmarkdown-it-hashtag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedify-dev%2Fmarkdown-it-hashtag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedify-dev%2Fmarkdown-it-hashtag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedify-dev%2Fmarkdown-it-hashtag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fedify-dev","download_url":"https://codeload.github.com/fedify-dev/markdown-it-hashtag/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fedify-dev%2Fmarkdown-it-hashtag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261240076,"owners_count":23129087,"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":["fediverse","hashtag","markdown","markdown-it","markdown-it-plugin"],"created_at":"2025-06-29T05:39:30.720Z","updated_at":"2025-06-29T05:39:34.375Z","avatar_url":"https://github.com/fedify-dev.png","language":"TypeScript","readme":"\u003c!-- deno-fmt-ignore-file --\u003e\n\n@fedify/markdown-it-hashtag\n===========================\n\n[![JSR][JSR badge]][JSR]\n[![npm][npm badge]][npm]\n[![GitHub Actions][GitHub Actions badge]][GitHub Actions]\n\nThis is a [markdown-it] plugin that parses and renders Mastodon-style #hashtags.\nIt converts, for example, `#FooBar` into a link:\n\n~~~~ html\n\u003ca href=\"#FooBar\"\u003e\u003cspan class=\"hash\"\u003e#\u003c/span\u003e\u003cspan class=\"tag\"\u003eFooBar\u003c/span\u003e\u003c/a\u003e\n~~~~\n\nThe value of `href` attributes, other attributes (if any), and the content of\nthe link can be customized by passing [options] to the plugin:\n\n~~~~ typescript\nimport MarkdownIt from \"markdown-it\";\nimport { hashtag, spanHashAndTag } from \"@fedify/markdown-it-hashtag\";\n\nconst md = new MarkdownIt();\nmd.use(hashtag, {\n  link: (tag: string) =\u003e `https://example.com/tags/${tag.substring(1)}`,\n  linkAttributes: (handle: string) =\u003e ({ class: \"hashtag\" }),\n  label: spanHashAndTag,\n});\n~~~~\n\nIf you want to collect all hashtags in a document, you can pass an environment\nobject to the `render()` method:\n\n~~~~ typescript\nconst env = {};\nmd.render(\n  \"Hello, #FooBar\\n\\n\u003e #BazQux\",\n  env,\n);\nconsole.log(env.hashtags);  // [\"#FooBar\", \"#BazQux\"]\n~~~~\n\n[JSR]: https://jsr.io/@fedify/markdown-it-hashtag\n[JSR badge]: https://jsr.io/badges/@fedify/markdown-it-hashtag\n[npm]: https://www.npmjs.com/package/@fedify/markdown-it-hashtag\n[npm badge]: https://img.shields.io/npm/v/%40fedify%2Fmarkdown-it-hashtag?logo=npm\n[GitHub Actions]: https://github.com/fedify-dev/markdown-it-hashtag/actions/workflows/main.yaml\n[GitHub Actions badge]: https://github.com/fedify-dev/markdown-it-hashtag/actions/workflows/main.yaml/badge.svg\n[markdown-it]: https://github.com/markdown-it/markdown-it\n[options]: https://jsr.io/@fedify/markdown-it-hashtag/doc/~/PluginOptions\n\n\nInstallation\n------------\n\n### Deno\n\n~~~~ sh\ndeno add @fedify/markdown-it-hashtag\n~~~~\n\n### Node.js\n\n~~~~ sh\nnpm add @fedify/markdown-it-hashtag\n~~~~\n\n### Bun\n\n~~~~ sh\nbun add @fedify/markdown-it-hashtag\n~~~~\n","funding_links":["https://opencollective.com/fedify","https://github.com/sponsors/dahlia"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedify-dev%2Fmarkdown-it-hashtag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffedify-dev%2Fmarkdown-it-hashtag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffedify-dev%2Fmarkdown-it-hashtag/lists"}