{"id":20227139,"url":"https://github.com/imrdjai/markdown-it-reddit-supsubscript","last_synced_at":"2026-05-30T21:31:57.657Z","repository":{"id":42521658,"uuid":"254649844","full_name":"iMrDJAi/markdown-it-reddit-supsubscript","owner":"iMrDJAi","description":"Reddit style super/sub scripts for markdown-it by ${Mr.DJA}.","archived":false,"fork":false,"pushed_at":"2023-03-07T06:16:01.000Z","size":171,"stargazers_count":2,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T00:29:31.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/iMrDJAi.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":"2020-04-10T14:07:09.000Z","updated_at":"2022-02-05T14:56:47.000Z","dependencies_parsed_at":"2025-01-13T23:35:07.620Z","dependency_job_id":"24bb7028-1ab5-4e03-885a-6d3d2736047c","html_url":"https://github.com/iMrDJAi/markdown-it-reddit-supsubscript","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"64e44862edf96a93139a70cb32750f09bed50ed8"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iMrDJAi%2Fmarkdown-it-reddit-supsubscript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iMrDJAi%2Fmarkdown-it-reddit-supsubscript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iMrDJAi%2Fmarkdown-it-reddit-supsubscript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iMrDJAi%2Fmarkdown-it-reddit-supsubscript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iMrDJAi","download_url":"https://codeload.github.com/iMrDJAi/markdown-it-reddit-supsubscript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241670155,"owners_count":20000327,"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-14T07:23:03.339Z","updated_at":"2026-05-30T21:31:57.650Z","avatar_url":"https://github.com/iMrDJAi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"***\r\n# markdown-it-reddit-supsubscript\r\n[![npm](https://img.shields.io/npm/v/markdown-it-reddit-supsubscript?color=red)](https://www.npmjs.com/package/markdown-it-reddit-supsubscript)\r\n\r\nReddit's super/subscript syntax for markdown-it by ${Mr.DJA}.\r\n***\r\n\r\nThis is a plugin for [markdown-it](https://github.com/markdown-it/markdown-it) uses [markdown-it-regexp](https://github.com/GerHobbelt/markdown-it-regexp) to render superscripts like those on Reddit: `^superscript` `^(superscript)`, and subscripts with a similar syntax: `~superscript` `~(superscript)`.\r\n\r\nIn fact Reddit doesn't support subscripts, but people need them so they are available here. Smart move huh? \\^-^\r\n\r\n\u003e ### ⚠ A note about v2.0.0:\r\n\u003e\r\n\u003e This version introduces breaking changes, it has a completely new API and uses a different implementation. The plugin doesn't depend on markdown-it directly anymore, instead, it uses the method `.renderInline()` from the `md` object that is already passed as an argument to the plugin function. Also, it depends on the fork `@gerhobbelt/markdown-it-regexp` now since it's more advanced than the original project.\r\n\u003e\r\n\u003e It's highly recommended to upgrade! The previous version is functional but not suitable for production use.\r\n\r\n## Installation\r\n**From NPM**:\r\n\r\n```bash\r\nnpm install markdown-it-reddit-supsubscript --save\r\n```\r\n```js\r\nconst markdownItRedditSupsubscript = require(\"markdown-it-reddit-supsubscript\")\r\n```\r\nThis works on Node. Use a module bundler if you want it for browser.\r\n\r\n**Browser**:\r\n\r\nA pre-built version for browser is available over [JsDeliver CDN](https://cdn.jsdelivr.net/gh/iMrDJAi/markdown-it-reddit-supsubscript/dist/markdown-it-reddit-supsubscript.min.js):\r\n```html\r\n\u003cscript src='https://cdn.jsdelivr.net/gh/iMrDJAi/markdown-it-reddit-supsubscript/dist/markdown-it-reddit-supsubscript.min.js'\u003e\u003c/script\u003e\r\n```\r\nIt will be available as `window.markdownItRedditSupsubscript`:\r\n```js\r\nconst markdownItRedditSupsubscript = window.markdownItRedditSupsubscript\r\n```\r\n\r\n\u003e ⚠ Warning!\r\n\u003e\r\n\u003e The previous version used a different name for the plugin: `markdownitRedditSupSubScript`. Make sure to update it to `markdownItRedditSupsubscript` when upgrading!\r\n\r\n## Usage\r\nThe usage is way simpler than it was in v1.0.0:\r\n\r\n```js\r\nconst markdownit = require('markdown-it')\r\nconst markdownItRedditSupsubscript = require('markdown-it-reddit-supsubscript')\r\n\r\nconst options = { // Default options. Use `false` to disable unwanted rules\r\n    superscriptParenthesized: true, // To enable ^(superscript)\r\n    superscript: true, // To enable ^superscript\r\n    subscriptParenthesized: true, // To enable ~(supscript)\r\n    subscript: true // To enable ~supscript\r\n}\r\n\r\nconst md = markdownit.use(\r\n    markdownItRedditSupsubscript, // Plugin\r\n    options // Options are not required\r\n)\r\n\r\nfunction renderMarkdown(text) { // A function to convert markdown to html\r\n    return md.render(text)\r\n}\r\n```\r\n\r\nPreview:\r\n\r\n![image](https://i.imgur.com/dMS8cAW.png)\r\n\r\n**Enjoy \u003c3**.\r\n\r\n## Dependents Projects\r\nWanna use **markdown-it-reddit-supsubscript** on your next big project? Let me now and it will be listed here! :)\r\n\r\n- [iMrDJAi-MDE](https://github.com/iMrDJAi/iMrDJAi-MDE): Open source, Simple, Easy to use and fully featured Markdown editor - by me.\r\n\r\n## Notes\r\n- This package has made by [${Mr.DJA}](https://github.com/iMrDJAi).\r\n- Do you like it? Gimme a star ⭐ and I'll smile 😃.  \r\n[![GitHub Repo stars](https://img.shields.io/github/stars/iMrDJAi/markdown-it-reddit-supsubscript?style=social)](https://github.com/iMrDJAi/markdown-it-reddit-supsubscript)\r\n- You are free to suggest anything and I will try to add it soon if I found it useful.\r\n- If you found any mistake (including the README file) feel free to help to fix it.\r\n- Please report any bugs.\r\n- **Made with ❤ in Algeria 🇩🇿**.\r\n\r\n## License\r\n[MIT](https://github.com/iMrDJAi/markdown-it-reddit-supsubscript/blob/master/LICENSE) © [iMrDJAi](https://github.com/iMrDJAi)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrdjai%2Fmarkdown-it-reddit-supsubscript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimrdjai%2Fmarkdown-it-reddit-supsubscript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimrdjai%2Fmarkdown-it-reddit-supsubscript/lists"}