{"id":19098684,"url":"https://github.com/bloggify/showdown-highlight","last_synced_at":"2025-11-05T19:01:47.762Z","repository":{"id":22234830,"uuid":"95678054","full_name":"Bloggify/showdown-highlight","owner":"Bloggify","description":":art: A Showdown extension for highlighting code blocks.","archived":false,"fork":false,"pushed_at":"2025-02-17T18:19:08.000Z","size":447,"stargazers_count":54,"open_issues_count":2,"forks_count":18,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T01:07:53.269Z","etag":null,"topics":["hacktoberfest","highlight","markdown","showdown"],"latest_commit_sha":null,"homepage":"","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/Bloggify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"2017-06-28T14:30:53.000Z","updated_at":"2025-02-17T18:19:11.000Z","dependencies_parsed_at":"2025-02-25T07:00:32.599Z","dependency_job_id":"621e771f-61e2-4809-9f54-f5ada371f080","html_url":"https://github.com/Bloggify/showdown-highlight","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloggify%2Fshowdown-highlight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloggify%2Fshowdown-highlight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloggify%2Fshowdown-highlight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Bloggify%2Fshowdown-highlight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Bloggify","download_url":"https://codeload.github.com/Bloggify/showdown-highlight/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248633962,"owners_count":21136955,"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":["hacktoberfest","highlight","markdown","showdown"],"created_at":"2024-11-09T03:47:06.204Z","updated_at":"2025-11-05T19:01:42.647Z","avatar_url":"https://github.com/Bloggify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. --\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n# showdown-highlight\n\n [![Version](https://img.shields.io/npm/v/showdown-highlight.svg)](https://www.npmjs.com/package/showdown-highlight) [![Downloads](https://img.shields.io/npm/dt/showdown-highlight.svg)](https://www.npmjs.com/package/showdown-highlight)\n\n\n\n\n\n\n\n\u003e A Showdown extension for highlight the code blocks.\n\n\n\n\n\n\nThis package uses [`highlight.js`](https://highlightjs.org) to highlight code blocks in [Showdown](https://github.com/showdownjs/showdown) output. :rocket:\n\n\n\n\n\n\n\n\n\n\n\n\n## :cloud: Installation\n\n```sh\n# Using npm\nnpm install --save showdown-highlight\n\n# Using yarn\nyarn add showdown-highlight\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :clipboard: Example\n\n\n\n```js\nconst showdown = require('showdown')\n    , showdownHighlight = require(\"showdown-highlight\")\n    ;\n\n// After requiring the module, use it as extension\nlet converter = new showdown.Converter({\n    // That's it\n    extensions: [showdownHighlight({\n        // Whether to add the classes to the \u003cpre\u003e tag, default is false\n        pre: true\n        // Whether to use hljs' auto language detection, default is true\n    ,   auto_detection: true\n    })]\n});\n\n// Now you can Highlight code blocks\nlet html = converter.makeHtml(`\n## Highlighting Code with Showdown\n\nBelow we have a piece of JavaScript code:\n\n\\`\\`\\`js\nfunction sayHello (msg, who) {\n    return \\`\\${who} says: msg\\`;\n}\nsayHello(\"Hello World\", \"Johnny\");\n\\`\\`\\`\n`);\n\nconsole.log(html);\n// \u003ch2 id=\"highlightingcodewithshowdown\"\u003eHighlighting Code with Showdown\u003c/h2\u003e\n//\n// \u003cp\u003eBelow we have a piece of JavaScript code:\u003c/p\u003e\n//\n// \u003cpre\u003e\u003ccode class=\"js language-js\"\u003e\u003cspan class=\"hljs-function\"\u003e\u003cspan class=\"hljs-keyword\"\u003efunction\u003c/span\u003e \u003cspan class=\"hljs-title\"\u003esayHello\u003c/span\u003e (\u003cspan class=\"hljs-params\"\u003emsg, who\u003c/span\u003e) \u003c/span\u003e{\n//     \u003cspan class=\"hljs-keyword\"\u003ereturn\u003c/span\u003e \u003cspan class=\"hljs-string\"\u003e`\u003cspan class=\"hljs-subst\"\u003e${who}\u003c/span\u003e says: msg`\u003c/span\u003e;\n// }\n// sayHello(\u003cspan class=\"hljs-string\"\u003e\"Hello World\"\u003c/span\u003e, \u003cspan class=\"hljs-string\"\u003e\"Johnny\"\u003c/span\u003e);\n// \u003c/code\u003e\u003c/pre\u003e\n```\n\n\n\n\n\n\n\n\n\n\n\n## :question: Get Help\n\nThere are few ways to get help:\n\n\n\n 1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.\n 2. For bug reports and feature requests, open issues. :bug:\n\n\n\n\n\n## :memo: Documentation\n\n\n### `showdownHighlight()`\nHighlight the code in the showdown input.\n\nExamples:\n\n```js\nlet converter = new showdown.Converter({\n    extensions: [showdownHighlight]\n})\n```\n\nEnable the classes in the `\u003cpre\u003e` element:\n\n```js\nlet converter = new showdown.Converter({\n    extensions: [showdownHighlight({ pre: true })]\n})\n```\n\nIf you want to disable language [auto detection](https://highlightjs.org/usage/)\nfeature of hljs, change `auto_detection` flag as `false`. With this option\nturned off, `showdown-highlight` will not process any codeblocks with no\nlanguage specified.\n\n```js\nlet converter = new showdown.Converter({\n    extensions: [showdownHighlight({ auto_detection: false })]\n})\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :yum: How to contribute\nHave an idea? Found a bug? See [how to contribute][contributing].\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n## :dizzy: Where is this library used?\nIf you are using this library in one of your projects, add it in this list. :sparkles:\n\n - `mdpdf`\n - `bloggify-markdown-highlight`\n - `github-readme-to-html`\n - `md-toy-blog`\n - `@kev_nz/publisher`\n - `@etermind/alex`\n - `@siradoc/siradoc`\n - `@web-native-js/chtml-cli`\n - `swanky`\n - `md-srv`\n - `docset-tools-markdown`\n - `callete`\n - `teroshdl2`\n - `ui_kitchenadmincenter`\n - `trumpdoc`\n - `@peersky/next-web3-chakra`\n - `mdpdf_jm`\n - `textbase`\n - `teroshdl`\n - `showdown-html`\n - `busi-ui`\n - `md-browse`\n - `markdown2dash`\n - `tutors-reader-lib`\n - `tutors-html-beta`\n - `tutors-html`\n - `examma-ray`\n - `steelsky`\n - `chimpsky`\n - `ember-showdown-highlight`\n - `showit`\n - `tutors-html-alpha`\n\n\n\n\n\n\n\n\n\n\n\n## :scroll: License\n\n[MIT][license] © [Bloggify][website]\n\n\n\n\n\n\n[license]: /LICENSE\n[website]: https://bloggify.org\n[contributing]: /CONTRIBUTING.md\n[docs]: /DOCUMENTATION.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloggify%2Fshowdown-highlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbloggify%2Fshowdown-highlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbloggify%2Fshowdown-highlight/lists"}