{"id":44866699,"url":"https://github.com/uttori/uttori-plugin-renderer-markdown-it","last_synced_at":"2026-02-17T11:34:51.497Z","repository":{"id":34490736,"uuid":"179773240","full_name":"uttori/uttori-plugin-renderer-markdown-it","owner":"uttori","description":"Uttori plugin for rendering Markdown powered by MarkdownIt","archived":false,"fork":false,"pushed_at":"2024-02-20T20:01:02.000Z","size":2795,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-09T01:14:56.708Z","etag":null,"topics":["markdown","markdownit","uttori","uttori-wiki"],"latest_commit_sha":null,"homepage":"https://wiki.superfamicom.org/","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/uttori.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2019-04-06T00:48:32.000Z","updated_at":"2021-12-27T20:49:56.000Z","dependencies_parsed_at":"2023-12-30T05:21:54.248Z","dependency_job_id":"af9b702e-fa72-4b30-a578-be5348993d58","html_url":"https://github.com/uttori/uttori-plugin-renderer-markdown-it","commit_stats":{"total_commits":94,"total_committers":1,"mean_commits":94.0,"dds":0.0,"last_synced_commit":"338b72df49642a0dffbc30b9c98530c5fa876fea"},"previous_names":["uttori/uttori-renderer-markdown-it"],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/uttori/uttori-plugin-renderer-markdown-it","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uttori%2Futtori-plugin-renderer-markdown-it","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uttori%2Futtori-plugin-renderer-markdown-it/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uttori%2Futtori-plugin-renderer-markdown-it/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uttori%2Futtori-plugin-renderer-markdown-it/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uttori","download_url":"https://codeload.github.com/uttori/uttori-plugin-renderer-markdown-it/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uttori%2Futtori-plugin-renderer-markdown-it/sbom","scorecard":{"id":913208,"data":{"date":"2025-08-11","repo":{"name":"github.com/uttori/uttori-plugin-renderer-markdown-it","commit":"bb1b4c3a53e9488507eb43b55c724ffb65f8b5b9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T20:01:08.379Z","repository_id":34490736,"created_at":"2025-08-24T20:01:08.379Z","updated_at":"2025-08-24T20:01:08.379Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29443447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T10:51:12.367Z","status":"ssl_error","status_checked_at":"2026-02-14T10:50:52.088Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","markdownit","uttori","uttori-wiki"],"created_at":"2026-02-17T11:34:46.153Z","updated_at":"2026-02-17T11:34:51.472Z","avatar_url":"https://github.com/uttori.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![view on npm](https://img.shields.io/npm/v/@uttori/plugin-renderer-markdown-it.svg)](https://www.npmjs.com/package/@uttori/plugin-renderer-markdown-it)\n[![npm module downloads](https://img.shields.io/npm/dt/@uttori/plugin-renderer-markdown-it)](https://www.npmjs.com/package/@uttori/plugin-renderer-markdown-it)\n[![Build Status](https://travis-ci.com/uttori/uttori-plugin-renderer-markdown-it.svg?branch=master)](https://app.travis-ci.com/github/uttori/uttori-plugin-renderer-markdown-it)\n[![Coverage Status](https://coveralls.io/repos/uttori/uttori-plugin-renderer-markdown-it/badge.svg?branch=master)](https://coveralls.io/r/uttori/uttori-plugin-renderer-markdown-it?branch=master)\n\n# Uttori Renderer - Markdown - MarkdownIt\n\nUttori renderer support for Markdown powered by [MarkdownIt](https://markdown-it.github.io/).\n\nThis also includes a MarkdownIt plugin you can use seperately that supports:\n\n* Generate a Table of Contents based on `H#` header tags with `[toc]`\n* Adding a URL prefix\n* Properly handle external domains with `noopener noreferrer` and optionally set up allowed domains for `nofollow` SEO support to curb spam\n* Support for `[^1] ... [^1]: Footnote` Footnotes based on [markdown-it-footnote](https://github.com/markdown-it/markdown-it-footnote)\n* Support for [WikiLinks](https://en.wikipedia.org/wiki/Help:Link#Wikilinks_(internal_links)) style linking\n* Support for adding [Lazy Loading](https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading) tags to `img` tags\n* Support for adding YouTube iframe videos\n* Support for `\u003cbr\u003e or \u003cbr/\u003e or \u003cbr /\u003e` style line breaks anywhere, useful for tables\n* Support for `\u003cvideo src=\"/uploads/example.mp4\"\u003e` video embeds with allowed domains filtering\n* Support for adding color to spans with `[Text](color:#ffadad)`\n* Parse to tokens for building an AST (abstract syntax tree) using `MarkdownItRenderer.parse(content, config)`\n\n## Install\n\n```bash\nnpm install --save @uttori/plugin-renderer-markdown-it\n```\n\n## Config\n\nConfiguration outside of registration events and Uttori specific items is avaliable by passing in [MarkdownIt](https://github.com/markdown-it/markdown-it#init-with-presets-and-options) config.\n\n```js\n{\n  // Registration Events\n  events: {\n    renderContent: [],\n    renderCollection: [],\n    validateConfig: [],\n    viewModelDetail: [],\n  },\n\n  // MarkdownIt Configuration\n  // Enable HTML tags in source\n  html: false,\n\n  // Use '/' to close single tags (\u003cbr /\u003e).\n  xhtmlOut: false,\n\n  // Convert '\\n' in paragraphs into \u003cbr\u003e, this is only for full CommonMark compatibility.\n  breaks: false,\n\n  // CSS language prefix for fenced blocks. Can be useful for external highlighters.\n  langPrefix: 'language-',\n\n  // Autoconvert URL-like text to links.\n  linkify: false,\n\n  // Enable some language-neutral replacement + quotes beautification.\n  typographer: false,\n\n  // Double + single quotes replacement pairs, when typographer enabled, and smartquotes on. Could be either a String or an Array.\n  // For example, you can use '«»„“' for Russian, '„“‚‘' for German, and ['«\\xA0', '\\xA0»', '‹\\xA0', '\\xA0›'] for French (including nbsp).\n  quotes: '“”‘’',\n\n  // Highlighter function. Should return escaped HTML, or '' if the source string is not changed and should be escaped externally.\n  // If result starts with \u003cpre... internal wrapper is skipped.\n  // highlight: (/* str, lang */) =\u003e '',\n\n  // Any other supported MarkdownIt configuration\n  ...,\n\n  // Custom Values for Uttori Specific Use\n  uttori: {\n    // Prefix for relative URLs, useful when the Express app is not at root.\n    baseUrl: '',\n\n    // Good Noodle List, f a domain is not in this list, it is set to 'external nofollow noreferrer'.\n    allowedExternalDomains: [],\n\n    // Open external domains in a new window.\n    openNewWindow: true,\n\n    // Add lazy loading params to image tags.\n    lazyImages: true,\n\n    // Footnotes\n    footnotes: {\n      // A funciton to return the default HTML for a footnote reference.\n      referenceTag: ({ id, label }) =\u003e {\n        return `...`;\n      },\n\n      // A funciton to return the default opening HTML for a footnote definition.\n      definitionOpenTag: ({ id, label }) =\u003e {\n        return `...`;\n      },\n\n      // The default closing HTML for a footnote definition.\n      definitionCloseTag: '\u003c/div\u003e\\n',\n    },\n\n    // Table of Contents\n    toc: {\n      // The opening DOM tag for the TOC container.\n      openingTag: '\u003cnav class=\"table-of-contents\"\u003e',\n\n      // The closing DOM tag for the TOC container.\n      closingTag: '\u003c/nav\u003e',\n\n      // Slugify options for convering headings to anchor links.\n      slugify: {\n        lower: true,\n      },\n    },\n\n    // WikiLinks\n    wikilinks: {\n      // Slugify options for convering Wikilinks to anchor links.\n      slugify: {\n        lower: true,\n      },\n    },\n  },\n}\n```\n\n### Table of Contents Generation\n\nYou can generate a table of contents based on the headers in a file. Example:\n\n```md\n# First\n## Second\n### Third\n### Third Again\n#### Fouth\n\n## Second Again\n### Third Last\nContent\n\n[toc]\n```\n\nWill render to a minified version of:\n\n```html\n\u003cp\u003e\n  \u003cnav class=\"table-of-contents\"\u003e\n    \u003cul class=\"table-of-contents-h1\"\u003e\n      \u003cli\u003e\u003ca href=\"#first-0\" title=\"First\"\u003eFirst\u003c/a\u003e\u003c/li\u003e\n      \u003cli\u003e\u003cul class=\"table-of-contents-h2\"\u003e\n        \u003cli\u003e\u003ca href=\"#second-1\" title=\"Second\"\u003eSecond\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cul class=\"table-of-contents-h3\"\u003e\n          \u003cli\u003e\u003ca href=\"#third-2\" title=\"Third\"\u003eThird\u003c/a\u003e\u003c/li\u003e\n          \u003cli\u003e\u003ca href=\"#third-again-3\" title=\"Third Again\"\u003eThird Again\u003c/a\u003e\u003c/li\u003e\n          \u003cli\u003e\u003cul class=\"table-of-contents-h4\"\u003e\n            \u003cli\u003e\u003ca href=\"#fouth-4\" title=\"Fouth\"\u003eFouth\u003c/a\u003e\u003c/li\u003e\n          \u003c/ul\u003e\u003c/li\u003e\n        \u003c/ul\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#second-again-6\" title=\"Second Again\"\u003eSecond Again\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003cul class=\"table-of-contents-h3\"\u003e\n          \u003cli\u003e\u003ca href=\"#third-last-7\" title=\"Third Last\"\u003eThird Last\u003c/a\u003e\u003c/li\u003e\n        \u003c/ul\u003e\u003c/li\u003e\n      \u003c/ul\u003e\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/nav\u003e\n  Content Content\n\u003c/p\u003e\n```\n\n### Footnotes\n\nThis allos for adding footnotes \u0026 their definitions.\n\n```md\n\n`ADC (dp,X)`[^1]\n\n[^1]: Add 1 cycle if m=0 (16-bit memory/accumulator)\n```\n\n### YouTube Embedding\n\nThis allows safe embedding of YouTube videos. Example:\n\n```md\n\u003cyoutube v=\"XG9dCoTlJYA\" start=\"0\" width=\"560\" height=\"315\" title=\"YouTube Video Player\" start=\"0\"\u003e\n```\n\nWill render to a minified version of:\n\n```html\n\u003cdiv class=\"youtube-embed\"\u003e\n  \u003ciframe class=\"youtube-embed-video\" width=\"560\" height=\"315\" src=\"https://www.youtube-nocookie.com/embed/aR3fVuLEtj8?start=0\" title=\"YouTube Video Player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"true\"\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n```\n\nThe only required parameter is `v`:\n\n```md\n\u003cyoutube v=\"aR3fVuLEtj8\"\u003e\n```\n\nWill render to a minified version of:\n\n```html\n\u003cdiv class=\"youtube-embed\"\u003e\n  \u003ciframe class=\"youtube-embed-video\" width=\"560\" height=\"315\" src=\"https://www.youtube-nocookie.com/embed/aR3fVuLEtj8?start=0\" title=\"\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"true\"\u003e\u003c/iframe\u003e\n\u003c/div\u003e\n```\n\n### Colored Text\n\nYou can add colored text with special links:\n\n```md\n[Text](color:#ffadad)\n[Text](color:#ffd6a5)\n[Text](color:#fdffb6)\n[Text](color:#caffbf)\n[Text](color:#9bf6ff)\n[Text](color:#A0C4FF)\n[Text](color:#bdb2ff)\n[Text](color:#ffcff8)\n[Text](color:#fffffc)\n[Text](color:rgba(0,0,0,0.5))\n```\n\n* * *\n\n## API Reference\n\n## Classes\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#MarkdownItRenderer\"\u003eMarkdownItRenderer\u003c/a\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003cp\u003eUttori MarkdownIt Renderer\u003c/p\u003e\n\u003c/dd\u003e\n\u003c/dl\u003e\n\n## Typedefs\n\n\u003cdl\u003e\n\u003cdt\u003e\u003ca href=\"#MarkdownItRendererOptions\"\u003eMarkdownItRendererOptions\u003c/a\u003e : \u003ccode\u003eobject\u003c/code\u003e\u003c/dt\u003e\n\u003cdd\u003e\u003c/dd\u003e\n\u003c/dl\u003e\n\n\u003ca name=\"MarkdownItRenderer\"\u003e\u003c/a\u003e\n\n## MarkdownItRenderer\nUttori MarkdownIt Renderer\n\n**Kind**: global class  \n\n* [MarkdownItRenderer](#MarkdownItRenderer)\n    * [.configKey](#MarkdownItRenderer.configKey) ⇒ \u003ccode\u003estring\u003c/code\u003e\n    * [.defaultConfig()](#MarkdownItRenderer.defaultConfig) ⇒ [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions)\n    * [.extendConfig(config)](#MarkdownItRenderer.extendConfig) ⇒ [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions)\n    * [.validateConfig(config, _context)](#MarkdownItRenderer.validateConfig)\n    * [.register(context)](#MarkdownItRenderer.register)\n    * [.renderContent(content, context)](#MarkdownItRenderer.renderContent) ⇒ \u003ccode\u003estring\u003c/code\u003e\n    * [.renderCollection(collection, context)](#MarkdownItRenderer.renderCollection) ⇒ \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\n    * [.render(content, [config])](#MarkdownItRenderer.render) ⇒ \u003ccode\u003estring\u003c/code\u003e\n    * [.parse(content, [config])](#MarkdownItRenderer.parse) ⇒ \u003ccode\u003eArray.\u0026lt;module:markdown-it/lib/token\u0026gt;\u003c/code\u003e\n    * [.cleanContent(content)](#MarkdownItRenderer.cleanContent) ⇒ \u003ccode\u003estring\u003c/code\u003e\n    * [.viewModelDetail(viewModel, context)](#MarkdownItRenderer.viewModelDetail) ⇒ \u003ccode\u003eobject\u003c/code\u003e\n\n\u003ca name=\"MarkdownItRenderer.configKey\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.configKey ⇒ \u003ccode\u003estring\u003c/code\u003e\nThe configuration key for plugin to look for in the provided configuration.\n\n**Kind**: static property of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - The configuration key.  \n**Example** *(MarkdownItRenderer.configKey)*  \n```js\nconst config = { ...MarkdownItRenderer.defaultConfig(), ...context.config[MarkdownItRenderer.configKey] };\n```\n\u003ca name=\"MarkdownItRenderer.defaultConfig\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.defaultConfig() ⇒ [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions)\nThe default configuration.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) - The default configuration.  \n**Example** *(MarkdownItRenderer.defaultConfig())*  \n```js\nconst config = { ...MarkdownItRenderer.defaultConfig(), ...context.config[MarkdownItRenderer.configKey] };\n```\n\u003ca name=\"MarkdownItRenderer.extendConfig\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.extendConfig(config) ⇒ [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions)\nCreate a config that is extended from the default config.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) - The new configration.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | The user provided configuration. |\n\n\u003ca name=\"MarkdownItRenderer.validateConfig\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.validateConfig(config, _context)\nValidates the provided configuration for required entries.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| config | \u003ccode\u003eRecord.\u0026lt;string, MarkdownItRendererOptions\u0026gt;\u003c/code\u003e | A provided configuration to use. |\n| _context | \u003ccode\u003eobject\u003c/code\u003e | Unused |\n\n**Example** *(MarkdownItRenderer.validateConfig(config, _context))*  \n```js\nMarkdownItRenderer.validateConfig({ ... });\n```\n\u003ca name=\"MarkdownItRenderer.register\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.register(context)\nRegister the plugin with a provided set of events on a provided Hook system.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| context | \u003ccode\u003eobject\u003c/code\u003e | A Uttori-like context. |\n| context.hooks | \u003ccode\u003eobject\u003c/code\u003e | An event system / hook system to use. |\n| context.hooks.on | \u003ccode\u003efunction\u003c/code\u003e | An event registration function. |\n| context.config | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | A provided configuration to use. |\n\n**Example** *(MarkdownItRenderer.register(context))*  \n```js\nconst context = {\n  hooks: {\n    on: (event, callback) =\u003e { ... },\n  },\n  config: {\n    [MarkdownItRenderer.configKey]: {\n      ...,\n      events: {\n        renderContent: ['render-content', 'render-meta-description'],\n        renderCollection: ['render-search-results'],\n        validateConfig: ['validate-config'],\n      },\n    },\n  },\n};\nMarkdownItRenderer.register(context);\n```\n\u003ca name=\"MarkdownItRenderer.renderContent\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.renderContent(content, context) ⇒ \u003ccode\u003estring\u003c/code\u003e\nRenders Markdown for a provided string with a provided context.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - The rendered content.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| content | \u003ccode\u003estring\u003c/code\u003e | Markdown content to be converted to HTML. |\n| context | \u003ccode\u003eobject\u003c/code\u003e | A Uttori-like context. |\n| context.config | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | A provided configuration to use. |\n\n**Example** *(MarkdownItRenderer.renderContent(content, context))*  \n```js\nconst context = {\n  config: {\n    [MarkdownItRenderer.configKey]: {\n      ...,\n    },\n  },\n};\nMarkdownItRenderer.renderContent(content, context);\n```\n\u003ca name=\"MarkdownItRenderer.renderCollection\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.renderCollection(collection, context) ⇒ \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e\nRenders Markdown for a collection of Uttori documents with a provided context.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e - } The rendered documents.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| collection | \u003ccode\u003eArray.\u0026lt;object\u0026gt;\u003c/code\u003e | A collection of Uttori documents. |\n| context | \u003ccode\u003eobject\u003c/code\u003e | A Uttori-like context. |\n| context.config | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | A provided MarkdownIt configuration to use. |\n\n**Example** *(MarkdownItRenderer.renderCollection(collection, context))*  \n```js\nconst context = {\n  config: {\n    [MarkdownItRenderer.configKey]: {\n      ...,\n    },\n  },\n};\nMarkdownItRenderer.renderCollection(collection, context);\n```\n\u003ca name=\"MarkdownItRenderer.render\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.render(content, [config]) ⇒ \u003ccode\u003estring\u003c/code\u003e\nRenders Markdown for a provided string with a provided MarkdownIt configuration.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - The rendered content.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| content | \u003ccode\u003estring\u003c/code\u003e | Markdown content to be converted to HTML. |\n| [config] | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | A provided MarkdownIt configuration to use. |\n\n**Example** *(MarkdownItRenderer.render(content, config))*  \n```js\nconst html = MarkdownItRenderer.render(content, config);\n```\n\u003ca name=\"MarkdownItRenderer.parse\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.parse(content, [config]) ⇒ \u003ccode\u003eArray.\u0026lt;module:markdown-it/lib/token\u0026gt;\u003c/code\u003e\nParse Markdown for a provided string with a provided MarkdownIt configuration.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003eArray.\u0026lt;module:markdown-it/lib/token\u0026gt;\u003c/code\u003e - The rendered content.  \n**See**: [MarkdownIt.parse](https://markdown-it.github.io/markdown-it/#MarkdownIt.parse)  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| content | \u003ccode\u003estring\u003c/code\u003e | Markdown content to be converted to HTML. |\n| [config] | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | A provided MarkdownIt configuration to use. |\n\n**Example** *(MarkdownItRenderer.parse(content, config))*  \n```js\nconst tokens = MarkdownItRenderer.parse(content, config);\n```\n\u003ca name=\"MarkdownItRenderer.cleanContent\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.cleanContent(content) ⇒ \u003ccode\u003estring\u003c/code\u003e\nRemoves empty links, as these have caused issues.\nFind missing links, and link them to the slug from the provided text.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003estring\u003c/code\u003e - The rendered content.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| content | \u003ccode\u003estring\u003c/code\u003e | Markdown content to be converted to HTML. |\n\n\u003ca name=\"MarkdownItRenderer.viewModelDetail\"\u003e\u003c/a\u003e\n\n### MarkdownItRenderer.viewModelDetail(viewModel, context) ⇒ \u003ccode\u003eobject\u003c/code\u003e\nWill attempt to extract the table of contents when set to and add it to the view model.\n\n**Kind**: static method of [\u003ccode\u003eMarkdownItRenderer\u003c/code\u003e](#MarkdownItRenderer)  \n**Returns**: \u003ccode\u003eobject\u003c/code\u003e - The view model.  \n\n| Param | Type | Description |\n| --- | --- | --- |\n| viewModel | \u003ccode\u003eobject\u003c/code\u003e | Markdown content to be converted to HTML. |\n| context | \u003ccode\u003eobject\u003c/code\u003e | A Uttori-like context. |\n| context.config | [\u003ccode\u003eMarkdownItRendererOptions\u003c/code\u003e](#MarkdownItRendererOptions) | A provided configuration to use. |\n\n**Example** *(MarkdownItRenderer.viewModelDetail(viewModel, context))*  \n```js\nviewModel = MarkdownItRenderer.viewModelDetail(viewModel, context);\n```\n\u003ca name=\"MarkdownItRendererOptions\"\u003e\u003c/a\u003e\n\n## MarkdownItRendererOptions : \u003ccode\u003eobject\u003c/code\u003e\n**Kind**: global typedef  \n**Properties**\n\n| Name | Type | Description |\n| --- | --- | --- |\n| baseUrl | \u003ccode\u003estring\u003c/code\u003e | Prefix for relative URLs, useful when the Express app is not at URI root. |\n| allowedExternalDomains | \u003ccode\u003eArray.\u0026lt;string\u0026gt;\u003c/code\u003e | Allowed External Domains, if a domain is not in this list, it is set to 'nofollow'. Values should be strings of the hostname portion of the URL object (like example.org). |\n| disableValidation | \u003ccode\u003eboolean\u003c/code\u003e | Optionally disable the built in Markdown-It link validation, large security risks when link validation is disabled. |\n| openNewWindow | \u003ccode\u003eboolean\u003c/code\u003e | Open external domains in a new window. |\n| lazyImages | \u003ccode\u003eboolean\u003c/code\u003e | Add lazy loading params to image tags. |\n| footnotes | \u003ccode\u003eobject\u003c/code\u003e | Footnote settings. |\n| footnotes.referenceTag | \u003ccode\u003efunction\u003c/code\u003e | A funciton to return the default HTML for a footnote reference. |\n| footnotes.definitionOpenTag | \u003ccode\u003efunction\u003c/code\u003e | A funciton to return the default opening HTML for a footnote definition. |\n| footnotes.definitionCloseTag | \u003ccode\u003estring\u003c/code\u003e | The default closing HTML for a footnote definition. |\n| toc | \u003ccode\u003eobject\u003c/code\u003e | Table of Contents settings. |\n| toc.extract | \u003ccode\u003eboolean\u003c/code\u003e | When true, extract the table of contents to the view model from the content. |\n| toc.openingTag | \u003ccode\u003estring\u003c/code\u003e | The opening DOM tag for the TOC container. |\n| toc.closingTag | \u003ccode\u003estring\u003c/code\u003e | The closing DOM tag for the TOC container. |\n| toc.slugify | \u003ccode\u003eobject\u003c/code\u003e | Slugify options for convering headings to anchor links. |\n| wikilinks | \u003ccode\u003eobject\u003c/code\u003e | WikiLinks settings. |\n| wikilinks.slugify | \u003ccode\u003eobject\u003c/code\u003e | Slugify options for convering Wikilinks to anchor links. |\n\n\n* * *\n\n## Tests\n\nTo run the test suite, first install the dependencies, then run `npm test`:\n\n```bash\nnpm install\nnpm test\nDEBUG=Uttori* npm test\n```\n\n## Contributors\n\n* [Matthew Callis](https://github.com/MatthewCallis)\n\n## License\n\n* [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futtori%2Futtori-plugin-renderer-markdown-it","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Futtori%2Futtori-plugin-renderer-markdown-it","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Futtori%2Futtori-plugin-renderer-markdown-it/lists"}