{"id":13452876,"url":"https://github.com/commonmark/commonmark-spec","last_synced_at":"2025-12-16T14:03:37.956Z","repository":{"id":19688416,"uuid":"22942790","full_name":"commonmark/commonmark-spec","owner":"commonmark","description":"CommonMark spec, with reference implementations in C and JavaScript","archived":false,"fork":false,"pushed_at":"2025-09-16T20:53:08.000Z","size":2953,"stargazers_count":5024,"open_issues_count":119,"forks_count":342,"subscribers_count":144,"default_branch":"master","last_synced_at":"2025-11-21T05:02:47.003Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://commonmark.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commonmark.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":null,"funding":".github/FUNDING.yml","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":{"github":["jgm"]}},"created_at":"2014-08-14T05:53:20.000Z","updated_at":"2025-11-17T03:19:02.000Z","dependencies_parsed_at":"2023-01-11T20:33:06.196Z","dependency_job_id":"ede256a1-35f6-4966-b652-c7cd1293e957","html_url":"https://github.com/commonmark/commonmark-spec","commit_stats":null,"previous_names":["jgm/stmd","commonmark/commonmark","jgm/commonmark"],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/commonmark/commonmark-spec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-spec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-spec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-spec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-spec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commonmark","download_url":"https://codeload.github.com/commonmark/commonmark-spec/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-spec/sbom","scorecard":{"id":301069,"data":{"date":"2025-08-11","repo":{"name":"github.com/commonmark/commonmark-spec","commit":"90c06837975098002cc89d3da1be30529919a8a2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"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 1 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":"Code-Review","score":5,"reason":"Found 14/28 approved changesets -- score normalized to 5","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":"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":"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":"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":"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":"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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 16 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"}}]},"last_synced_at":"2025-08-17T20:38:25.629Z","repository_id":19688416,"created_at":"2025-08-17T20:38:25.629Z","updated_at":"2025-08-17T20:38:25.629Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27765951,"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","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-07-31T08:00:25.742Z","updated_at":"2025-12-16T14:03:37.937Z","avatar_url":"https://github.com/commonmark.png","language":"Python","funding_links":["https://github.com/sponsors/jgm"],"categories":["Python","Utilities","公用事业","others","Utilities ##"],"sub_categories":["YAML","Vim ###"],"readme":"CommonMark\n==========\n\nCommonMark is a rationalized version of Markdown syntax,\nwith a [spec][the spec] and BSD-licensed reference\nimplementations in C and JavaScript.\n\n[Try it now!](https://spec.commonmark.org/dingus/)\n\n[the spec]:  https://spec.commonmark.org/\n\nFor more details, see \u003chttps://commonmark.org\u003e.\n\nThis repository contains the spec itself, along with tools for\nrunning tests against the spec, and for creating HTML and PDF versions\nof the spec.\n\nThe reference implementations live in separate repositories:\n\n- \u003chttps://github.com/commonmark/cmark\u003e (C)\n- \u003chttps://github.com/commonmark/commonmark.js\u003e (JavaScript)\n\nThere is a list of third-party libraries\nin a dozen different languages\n[here](https://github.com/commonmark/CommonMark/wiki/List-of-CommonMark-Implementations).\n\nRunning tests against the spec\n------------------------------\n\n[The spec] contains over 500 embedded examples which serve as conformance\ntests. To run the tests using an executable `$PROG`:\n\n    python3 test/spec_tests.py --program $PROG\n\nIf you want to extract the raw test data from the spec without\nactually running the tests, you can do:\n\n    python3 test/spec_tests.py --dump-tests\n\nand you'll get all the tests in JSON format.\n\nJavaScript developers may find it more convenient to use the\n[`commonmark-spec` npm package], which is published from this\nrepository.  It exports an array `tests` of JSON objects with\nthe format\n\n```json\n{\n  \"markdown\": \"Foo\\nBar\\n---\\n\",\n  \"html\": \"\u003ch2\u003eFoo\\nBar\u003c/h2\u003e\\n\",\n  \"section\": \"Setext headings\",\n  \"number\": 65\n}\n```\n\n[`commonmark-spec` npm package]: https://www.npmjs.com/package/commonmark-spec\n\nThe spec\n--------\n\nThe source of [the spec] is `spec.txt`.  This is basically a Markdown\nfile, with code examples written in a shorthand form:\n\n    ```````````````````````````````` example\n    Markdown source\n    .\n    expected HTML output\n    ````````````````````````````````\n\nTo build an HTML version of the spec, do `make spec.html`.  To build a\nPDF version, do `make spec.pdf`.  For both versions, you must\nhave the lua rock `lcmark` installed:  after installing lua and\nlua rocks, `luarocks install lcmark`.  For the PDF you must also\nhave xelatex installed.\n\nThe spec is written from the point of view of the human writer, not\nthe computer reader.  It is not an algorithm---an English translation of\na computer program---but a declarative description of what counts as a block\nquote, a code block, and each of the other structural elements that can\nmake up a Markdown document.\n\nBecause John Gruber's [canonical syntax\ndescription](https://daringfireball.net/projects/markdown/syntax) leaves\nmany aspects of the syntax undetermined, writing a precise spec requires\nmaking a large number of decisions, many of them somewhat arbitrary.\nIn making them, we have appealed to existing conventions and\nconsiderations of simplicity, readability, expressive power, and\nconsistency.  We have tried to ensure that \"normal\" documents in the many\nincompatible existing implementations of Markdown will render, as far as\npossible, as their authors intended.  And we have tried to make the rules\nfor different elements work together harmoniously.  In places where\ndifferent decisions could have been made (for example, the rules\ngoverning list indentation), we have explained the rationale for\nour choices.  In a few cases, we have departed slightly from the canonical\nsyntax description, in ways that we think further the goals of Markdown\nas stated in that description.\n\nFor the most part, we have limited ourselves to the basic elements\ndescribed in Gruber's canonical syntax description, eschewing extensions\nlike footnotes and definition lists.  It is important to get the core\nright before considering such things. However, we have included a visible\nsyntax for line breaks and fenced code blocks.\n\nDifferences from original Markdown\n----------------------------------\n\nThere are only a few places where this spec says things that contradict\nthe canonical syntax description:\n\n-   It allows all punctuation symbols to be backslash-escaped,\n    not just the symbols with special meanings in Markdown. We found\n    that it was just too hard to remember which symbols could be\n    escaped.\n\n-   It introduces an alternative syntax for hard line\n    breaks, a backslash at the end of the line, supplementing the\n    two-spaces-at-the-end-of-line rule. This is motivated by persistent\n    complaints about the “invisible” nature of the two-space rule.\n\n-   Link syntax has been made a bit more predictable (in a\n    backwards-compatible way). For example, `Markdown.pl` allows single\n    quotes around a title in inline links, but not in reference links.\n    This kind of difference is really hard for users to remember, so the\n    spec allows single quotes in both contexts.\n\n-   The rule for HTML blocks differs, though in most real cases it\n    shouldn't make a difference. (See the section on HTML Blocks\n    for details.) The spec's proposal makes it easy to include Markdown\n    inside HTML block-level tags, if you want to, but also allows you to\n    exclude this. It also makes parsing much easier, avoiding\n    expensive backtracking.\n\n-   It does not collapse adjacent bird-track blocks into a single\n    blockquote:\n\n        \u003e these are two\n\n        \u003e blockquotes\n\n        \u003e this is a single\n        \u003e\n        \u003e blockquote with two paragraphs\n\n-   Rules for content in lists differ in a few respects, though (as with\n    HTML blocks), most lists in existing documents should render as\n    intended. There is some discussion of the choice points and\n    differences in the subsection of List Items entitled Motivation.\n    We think that the spec's proposal does better than any existing\n    implementation in rendering lists the way a human writer or reader\n    would intuitively understand them. (We could give numerous examples\n    of perfectly natural looking lists that nearly every existing\n    implementation flubs up.)\n\n-   Changing bullet characters, or changing from bullets to numbers or\n    vice versa, starts a new list. We think that is almost always going\n    to be the writer's intent.\n\n-   The number that begins an ordered list item may be followed by\n    either `.` or `)`. Changing the delimiter style starts a new\n    list.\n\n-   The start number of an ordered list is significant.\n\n-   Fenced code blocks are supported, delimited by either\n    backticks (```` ``` ````) or tildes (` ~~~ `).\n\nContributing\n------------\n\nThere is a [forum for discussing\nCommonMark](https://talk.commonmark.org); you should use it instead of\ngithub issues for questions and possibly open-ended discussions.\nUse the [github issue tracker](https://github.com/commonmark/CommonMark/issues)\nonly for simple, clear, actionable issues.\n\nAuthors\n-------\n\nThe spec was written by John MacFarlane, drawing on\n\n- his experience writing and maintaining Markdown implementations in several\n  languages, including the first Markdown parser not based on regular\n  expression substitutions ([pandoc](https://github.com/jgm/pandoc)) and\n  the first markdown parsers based on PEG grammars\n  ([peg-markdown](https://github.com/jgm/peg-markdown),\n  [lunamark](https://github.com/jgm/lunamark))\n- a detailed examination of the differences between existing Markdown\n  implementations using [BabelMark 2](https://johnmacfarlane.net/babelmark2/),\n  and\n- extensive discussions with David Greenspan, Jeff Atwood, Vicent\n  Marti, Neil Williams, and Benjamin Dumke-von der Ehe.\n\nSince the first announcement, many people have contributed ideas.\nKārlis Gaņģis was especially helpful in refining the rules for\nemphasis, strong emphasis, links, and images.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonmark%2Fcommonmark-spec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommonmark%2Fcommonmark-spec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonmark%2Fcommonmark-spec/lists"}