{"id":43364825,"url":"https://github.com/dweidner/markdown-it-attribution","last_synced_at":"2026-02-02T04:41:29.348Z","repository":{"id":54568568,"uuid":"209584381","full_name":"dweidner/markdown-it-attribution","owner":"dweidner","description":"Add attribution to your quotations","archived":false,"fork":false,"pushed_at":"2021-02-10T07:37:04.000Z","size":505,"stargazers_count":12,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T06:39:02.287Z","etag":null,"topics":["markdown","markdown-it","markdown-it-plugin"],"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/dweidner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-19T15:10:27.000Z","updated_at":"2025-06-22T15:00:57.000Z","dependencies_parsed_at":"2022-08-13T20:00:52.516Z","dependency_job_id":null,"html_url":"https://github.com/dweidner/markdown-it-attribution","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/dweidner/markdown-it-attribution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweidner%2Fmarkdown-it-attribution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweidner%2Fmarkdown-it-attribution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweidner%2Fmarkdown-it-attribution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweidner%2Fmarkdown-it-attribution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dweidner","download_url":"https://codeload.github.com/dweidner/markdown-it-attribution/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dweidner%2Fmarkdown-it-attribution/sbom","scorecard":{"id":361248,"data":{"date":"2025-08-11","repo":{"name":"github.com/dweidner/markdown-it-attribution","commit":"754b433e2781b9fedf272fae83c20af717f0eebd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/13 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":"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":"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":"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":"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":"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.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt: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 3 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":"62 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-6chw-6frg-f759","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-wg6g-ppvx-927h","Warn: Project is vulnerable to: GHSA-897m-rjf5-jp39","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-vh7m-p724-62c2","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-6vfc-qv3f-vr6c","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"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-18T10:54:08.516Z","repository_id":54568568,"created_at":"2025-08-18T10:54:08.516Z","updated_at":"2025-08-18T10:54:08.516Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29005764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T04:25:24.522Z","status":"ssl_error","status_checked_at":"2026-02-02T04:24:51.069Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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","markdown-it","markdown-it-plugin"],"created_at":"2026-02-02T04:41:28.774Z","updated_at":"2026-02-02T04:41:29.343Z","avatar_url":"https://github.com/dweidner.png","language":"JavaScript","readme":"# markdown-it-attribution\n\n[![NPM version](https://img.shields.io/npm/v/markdown-it-attribution.svg?style=flat)](https://www.npmjs.org/package/markdown-it-attribution)\n[![Build Status](https://img.shields.io/travis/dweidner/markdown-it-attribution/master.svg?style=flat)](https://travis-ci.org/dweidner/markdown-it-attribution)\n[![Coverage Status](https://coveralls.io/repos/github/dweidner/markdown-it-attribution/badge.svg?branch=master)](https://coveralls.io/github/dweidner/markdown-it-attribution?branch=master)\n\n\u003e A plugin for [markdown-it](https://github.com/markdown-it/markdown-it) that\n\u003e generates accessible markup for block quotes with attribution line. The\n\u003e generated output follows the suggestions in the living standard of the\n\u003e [WHATWG](https://html.spec.whatwg.org/multipage/grouping-content.html#the-blockquote-element).\n\n**Requires `markdown-it` v5.+**\n\nThe plugin allows to provide an attribution for a quotation:\n\n```md\n\u003e That's one small step for [a] man, one giant leap for mankind.  \n\u003e — Neil Armstrong (1969, July 21)\n```\n\nThe generated markup is not only accessible for screen readers but allows you to style the attribution line however you like:\n\n```html\n\u003cfigure class=\"c-blockquote\"\u003e\n  \u003cblockquote\u003e\n    \u003cp\u003e\n      That's one small step for [a] man, one giant leap for mankind.  \n    \u003c/p\u003e\n  \u003c/blockquote\u003e\n  \u003cfigcaption class=\"c-blockquote__attribution\"\u003e\n    Neil Armstrong (1969, July 21)\n  \u003c/figcaption\u003e\n\u003c/figure\u003e\n```\n\nBy default an `em dash` is used as the marker for an attribution line. Note that the `em dash` has to follow a soft break or has to be *the first character* of a new paragraph. This restriction should avoid situation in which an `em dash` is used within the body of a quotation. You can customize the characters used as an attribution marker. Have a look at the available [plugin options](#options) for more details.\n\n## Install\n\nnode:\n\n```bash\nnpm install --save markdown-it markdown-it-attribution\n```\n\n## Usage\n\n```js\nvar md = require('markdown-it')()\n  .use(require('markdown-it-attribution'));\n\nvar blockquote = [\n  '\u003e That\\'s one small step for [a] man, one giant leap for mankind.',\n  '\u003e — Neil Armstrong (1969, July 21)'\n];\n\nmd.render(blockquote.join('\\n'));\n```\n\n### Options\n\nYou can customize the plugin behavior by providing custom options when you register the parser plugin:\n\n```js\nvar md = require('markdown-it')()\n  .use(require('markdown-it-attribution'), {\n    classNameContainer: 'c-quote',\n    classNameAttribution: 'c-quote__attribution',\n    marker: '--',\n    removeMarker: false,\n  });\n\nmd.render('…');\n```\n\nList of available options:\n\n- `[classNameContainer='c-blockquote']` - Select the HTML class added to the container of the `blockquote`.\n- `[classNameAttribution='c-blockquote__attribution']` - Select the HTML class added to the container of an attribution line.\n- `[marker='—']` - Select the characters used to identify the beginning of an attribution line.\n- `[removeMarker=true]` - Determines whether the attribution marker will be included in the generated markup.\n\n### Customization\n\nLike always you can customize the output of all the elements generated by `markdown-it`. If you want to change the HTML element used for the container and the attribution you can provide your own template functions:\n\n```js\n// Setup the markdown it parser.\nvar md = require('markdown-it')()\n  .use(require('markdown-it-attribution'));\n\n/**\n * A utility function used to generate custom template functions which returns\n * the markup for an HTML tag.\n *\n * @param {string} name The name of the HTML tag.\n * @param {Boolean} open Whether an opening or closing tag should be generated.\n * @return {Function}\n */\nfunction tag (name, open) {\n  return function () {\n    return open ? '\u003c' + name + '\u003e' : '\u003c/' + name + '\u003e';\n  }\n}\n\n// Overwrite the template functions for the various elements.\nmd.renderer.rules.blockquote_container_open = tag('aside', true);\nmd.renderer.rules.blockquote_attribution_open = tag('div', true);\nmd.renderer.rules.blockquote_attribution_close = tag('div', false);\nmd.renderer.rules.blockquote_container_close = tag('aside', false);\n```\n\n## Motivation\n\nI wanted to add an attribution line to the generated markup of some of my block quotes (including the `cite` attribute) and searched for an unobtrusive way. The current solution still looks good in applications that do not support the custom syntax and provides accessible markup otherwise.\n\n## License\n\n[MIT](https://github.com/dweidner/markdown-it-attribution/blob/master/LICENSE.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweidner%2Fmarkdown-it-attribution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdweidner%2Fmarkdown-it-attribution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdweidner%2Fmarkdown-it-attribution/lists"}