{"id":13514828,"url":"https://github.com/commonmark/commonmark-java","last_synced_at":"2026-01-16T11:44:27.853Z","repository":{"id":35218742,"uuid":"39477878","full_name":"commonmark/commonmark-java","owner":"commonmark","description":"Java library for parsing and rendering CommonMark (Markdown)","archived":false,"fork":false,"pushed_at":"2026-01-13T16:38:38.000Z","size":2392,"stargazers_count":2619,"open_issues_count":12,"forks_count":320,"subscribers_count":99,"default_branch":"main","last_synced_at":"2026-01-14T01:48:51.797Z","etag":null,"topics":["commonmark","java","library","markdown","parser","renderer"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/commonmark.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-07-22T01:08:55.000Z","updated_at":"2026-01-13T16:38:42.000Z","dependencies_parsed_at":"2024-01-17T02:35:15.234Z","dependency_job_id":"2338524d-3958-4431-8f94-5ebcf4831684","html_url":"https://github.com/commonmark/commonmark-java","commit_stats":null,"previous_names":["atlassian/commonmark-java"],"tags_count":42,"template":false,"template_full_name":null,"purl":"pkg:github/commonmark/commonmark-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/commonmark","download_url":"https://codeload.github.com/commonmark/commonmark-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/commonmark%2Fcommonmark-java/sbom","scorecard":{"id":214758,"data":{"date":"2025-08-11","repo":{"name":"github.com/commonmark/commonmark-java","commit":"9926b761eb2e9192d80cda46917ea2f0f0f2c7dc"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/17 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":"Maintained","score":10,"reason":"30 commit(s) and 7 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"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":"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":9,"reason":"binaries present in source code","details":["Warn: binary detected: commonmark-android-test/gradle/wrapper/gradle-wrapper.jar:1"],"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/commonmark/commonmark-java/release.yml/main?enable=pin","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"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: BSD 2-Clause \"Simplified\" 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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 23 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":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"}}]},"last_synced_at":"2025-08-17T01:26:54.588Z","repository_id":35218742,"created_at":"2025-08-17T01:26:54.588Z","updated_at":"2025-08-17T01:26:54.588Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"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":["commonmark","java","library","markdown","parser","renderer"],"created_at":"2024-08-01T05:01:02.369Z","updated_at":"2026-01-16T11:44:27.841Z","avatar_url":"https://github.com/commonmark.png","language":"Java","readme":"commonmark-java\n===============\n\nJava library for parsing and rendering [Markdown] text according to the\n[CommonMark] specification (and some extensions).\n\n[![Maven Central status](https://img.shields.io/maven-central/v/org.commonmark/commonmark.svg)](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.commonmark%22)\n[![javadoc](https://www.javadoc.io/badge/org.commonmark/commonmark.svg?color=blue)](https://www.javadoc.io/doc/org.commonmark/commonmark)\n[![ci](https://github.com/commonmark/commonmark-java/workflows/ci/badge.svg)](https://github.com/commonmark/commonmark-java/actions?query=workflow%3Aci)\n[![codecov](https://codecov.io/gh/commonmark/commonmark-java/branch/main/graph/badge.svg)](https://codecov.io/gh/commonmark/commonmark-java)\n[![SourceSpy Dashboard](https://sourcespy.com/shield.svg)](https://sourcespy.com/github/commonmarkcommonmarkjava/)\n\nIntroduction\n------------\n\nProvides classes for parsing input to an abstract syntax tree (AST),\nvisiting and manipulating nodes, and rendering to HTML or back to Markdown.\nIt started out as a port of [commonmark.js], but has since evolved into an\nextensible library with the following features:\n\n* Small (core has no dependencies, extensions in separate artifacts)\n* Fast (10-20 times faster than [pegdown] which used to be a popular Markdown\n  library, see benchmarks in repo)\n* Flexible (manipulate the AST after parsing, customize HTML rendering)\n* Extensible (tables, strikethrough, autolinking and more, see below)\n\nThe library is supported on Java 11 and later. It works on Android too,\nbut that is on a best-effort basis, please report problems. For Android the\nminimum API level is 19, see the\n[commonmark-android-test](commonmark-android-test)\ndirectory.\n\nCoordinates for core library (see all on [Maven Central]):\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.commonmark\u003c/groupId\u003e\n    \u003cartifactId\u003ecommonmark\u003c/artifactId\u003e\n    \u003cversion\u003e0.27.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThe module names to use in Java 9 are `org.commonmark`,\n`org.commonmark.ext.autolink`, etc, corresponding to package names.\n\nNote that for 0.x releases of this library, the API is not considered stable\nyet and may break between minor releases. After 1.0, [Semantic Versioning] will\nbe followed. A package containing `beta` means it's not subject to stable API\nguarantees yet; but for normal usage it should not be necessary to use.\n\nSee the [spec.txt](commonmark-test-util/src/main/resources/spec.txt)\nfile if you're wondering which version of the spec is currently\nimplemented. Also check out the [CommonMark dingus] for getting familiar\nwith the syntax or trying out edge cases. If you clone the repository,\nyou can also use the `DingusApp` class to try out things interactively.\n\n\nUsage\n-----\n\n#### Parse and render to HTML\n\n```java\nimport org.commonmark.node.*;\nimport org.commonmark.parser.Parser;\nimport org.commonmark.renderer.html.HtmlRenderer;\n\nParser parser = Parser.builder().build();\nNode document = parser.parse(\"This is *Markdown*\");\nHtmlRenderer renderer = HtmlRenderer.builder().build();\nrenderer.render(document);  // \"\u003cp\u003eThis is \u003cem\u003eMarkdown\u003c/em\u003e\u003c/p\u003e\\n\"\n```\n\nThis uses the parser and renderer with default options. Both builders have\nmethods for configuring their behavior:\n\n* `escapeHtml(true)` on `HtmlRenderer` will escape raw HTML tags and blocks.\n* `sanitizeUrls(true)` on `HtmlRenderer` will strip potentially unsafe URLs\n  from `\u003ca\u003e` and `\u003cimg\u003e` tags\n* For all available options, see methods on the builders.\n\nNote that this library doesn't try to sanitize the resulting HTML with regards\nto which tags are allowed, etc. That is the responsibility of the caller, and\nif you expose the resulting HTML, you probably want to run a sanitizer on it\nafter this.\n\n#### Render to Markdown\n\n```java\nimport org.commonmark.node.*;\nimport org.commonmark.renderer.markdown.MarkdownRenderer;\n\nMarkdownRenderer renderer = MarkdownRenderer.builder().build();\nNode document = new Document();\nHeading heading = new Heading();\nheading.setLevel(2);\nheading.appendChild(new Text(\"My title\"));\ndocument.appendChild(heading);\n\nrenderer.render(document);  // \"## My title\\n\"\n```\n\nFor rendering to plain text with minimal markup, there's also `TextContentRenderer`.\n\n#### Use a visitor to process parsed nodes\n\nAfter the source text has been parsed, the result is a tree of nodes.\nThat tree can be modified before rendering, or just inspected without\nrendering:\n\n```java\nNode node = parser.parse(\"Example\\n=======\\n\\nSome more text\");\nWordCountVisitor visitor = new WordCountVisitor();\nnode.accept(visitor);\nvisitor.wordCount;  // 4\n\nclass WordCountVisitor extends AbstractVisitor {\n    int wordCount = 0;\n\n    @Override\n    public void visit(Text text) {\n        // This is called for all Text nodes. Override other visit methods for other node types.\n\n        // Count words (this is just an example, don't actually do it this way for various reasons).\n        wordCount += text.getLiteral().split(\"\\\\W+\").length;\n\n        // Descend into children (could be omitted in this case because Text nodes don't have children).\n        visitChildren(text);\n    }\n}\n```\n\n#### Source positions\n\nIf you want to know where a parsed `Node` appeared in the input source text,\nyou can request the parser to return source positions like this:\n\n```java\nvar parser = Parser.builder().includeSourceSpans(IncludeSourceSpans.BLOCKS_AND_INLINES).build();\n```\n\nThen parse nodes and inspect source positions:\n\n```java\nvar source = \"foo\\n\\nbar *baz*\";\nvar doc = parser.parse(source);\nvar emphasis = doc.getLastChild().getLastChild();\nvar s = emphasis.getSourceSpans().get(0);\ns.getLineIndex();    // 2 (third line)\ns.getColumnIndex();  // 4 (fifth column)\ns.getInputIndex();   // 9 (string index 9)\ns.getLength();       // 5\nsource.substring(s.getInputIndex(), s.getInputIndex() + s.getLength());  // \"*baz*\"\n```\n\nIf you're only interested in blocks and not inlines, use `IncludeSourceSpans.BLOCKS`.\n\n#### Add or change attributes of HTML elements\n\nSometimes you might want to customize how HTML is rendered. If all you\nwant to do is add or change attributes on some elements, there's a\nsimple way to do that.\n\nIn this example, we register a factory for an `AttributeProvider` on the\nrenderer to set a `class=\"border\"` attribute on `img` elements.\n\n```java\nParser parser = Parser.builder().build();\nHtmlRenderer renderer = HtmlRenderer.builder()\n        .attributeProviderFactory(new AttributeProviderFactory() {\n            public AttributeProvider create(AttributeProviderContext context) {\n                return new ImageAttributeProvider();\n            }\n        })\n        .build();\n\nNode document = parser.parse(\"![text](/url.png)\");\nrenderer.render(document);\n// \"\u003cp\u003e\u003cimg src=\\\"/url.png\\\" alt=\\\"text\\\" class=\\\"border\\\" /\u003e\u003c/p\u003e\\n\"\n\nclass ImageAttributeProvider implements AttributeProvider {\n    @Override\n    public void setAttributes(Node node, String tagName, Map\u003cString, String\u003e attributes) {\n        if (node instanceof Image) {\n            attributes.put(\"class\", \"border\");\n        }\n    }\n}\n```\n\n#### Customize HTML rendering\n\nIf you want to do more than just change attributes, there's also a way\nto take complete control over how HTML is rendered.\n\nIn this example, we're changing the rendering of indented code blocks to\nonly wrap them in `pre` instead of `pre` and `code`:\n\n```java\nParser parser = Parser.builder().build();\nHtmlRenderer renderer = HtmlRenderer.builder()\n        .nodeRendererFactory(new HtmlNodeRendererFactory() {\n            public NodeRenderer create(HtmlNodeRendererContext context) {\n                return new IndentedCodeBlockNodeRenderer(context);\n            }\n        })\n        .build();\n\nNode document = parser.parse(\"Example:\\n\\n    code\");\nrenderer.render(document);\n// \"\u003cp\u003eExample:\u003c/p\u003e\\n\u003cpre\u003ecode\\n\u003c/pre\u003e\\n\"\n\nclass IndentedCodeBlockNodeRenderer implements NodeRenderer {\n\n    private final HtmlWriter html;\n\n    IndentedCodeBlockNodeRenderer(HtmlNodeRendererContext context) {\n        this.html = context.getWriter();\n    }\n\n    @Override\n    public Set\u003cClass\u003c? extends Node\u003e\u003e getNodeTypes() {\n        // Return the node types we want to use this renderer for.\n        return Set.of(IndentedCodeBlock.class);\n    }\n\n    @Override\n    public void render(Node node) {\n        // We only handle one type as per getNodeTypes, so we can just cast it here.\n        IndentedCodeBlock codeBlock = (IndentedCodeBlock) node;\n        html.line();\n        html.tag(\"pre\");\n        html.text(codeBlock.getLiteral());\n        html.tag(\"/pre\");\n        html.line();\n    }\n}\n```\n\n#### Add your own node types\n\nIn case you want to store additional data in the document or have custom\nelements in the resulting HTML, you can create your own subclass of\n`CustomNode` and add instances as child nodes to existing nodes.\n\nTo define the HTML rendering for them, you can use a `NodeRenderer` as\nexplained above.\n\n#### Customize parsing\n\nThere are a few ways to extend parsing or even override built-in parsing,\nall of them via methods on `Parser.Builder`\n(see [Blocks and inlines](https://spec.commonmark.org/0.31.2/#blocks-and-inlines) in the spec for an overview of blocks/inlines):\n\n- Parsing of specific block types (e.g. headings, code blocks, etc) can be\n  enabled/disabled with `enabledBlockTypes`\n- Parsing of blocks can be extended/overridden with `customBlockParserFactory`\n- Parsing of inline content can be extended/overridden with `customInlineContentParserFactory`\n- Parsing of [delimiters](https://spec.commonmark.org/0.31.2/#emphasis-and-strong-emphasis) in inline content can be\n  extended with `customDelimiterProcessor`\n- Processing of links can be customized with `linkProcessor` and `linkMarker`\n\n#### Thread-safety\n\nBoth the `Parser` and `HtmlRenderer` are designed so that you can\nconfigure them once using the builders and then use them multiple\ntimes/from multiple threads. This is done by separating the state for\nparsing/rendering from the configuration.\n\nHaving said that, there might be bugs of course. If you find one, please\nreport an issue.\n\n### API documentation\n\nJavadocs are available online on\n[javadoc.io](https://www.javadoc.io/doc/org.commonmark/commonmark).\n\n\nExtensions\n----------\n\nExtensions need to extend the parser, or the HTML renderer, or both. To\nuse an extension, the builder objects can be configured with a list of\nextensions. Because extensions are optional, they live in separate\nartifacts, so additional dependencies need to be added as well.\n\nLet's look at how to enable tables from GitHub Flavored Markdown.\nFirst, add an additional dependency (see [Maven Central] for others):\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.commonmark\u003c/groupId\u003e\n    \u003cartifactId\u003ecommonmark-ext-gfm-tables\u003c/artifactId\u003e\n    \u003cversion\u003e0.27.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nThen, configure the extension on the builders:\n\n```java\nimport org.commonmark.ext.gfm.tables.TablesExtension;\n\nList\u003cExtension\u003e extensions = List.of(TablesExtension.create());\nParser parser = Parser.builder()\n        .extensions(extensions)\n        .build();\nHtmlRenderer renderer = HtmlRenderer.builder()\n        .extensions(extensions)\n        .build();\n```\n\nTo configure another extension in the above example, just add it to the list.\n\nThe following extensions are developed with this library, each in their\nown artifact.\n\n### Autolink\n\nTurns plain links such as URLs and email addresses into links (based on [autolink-java]).\n\nUse class `AutolinkExtension` from artifact `commonmark-ext-autolink`.\n\n### Strikethrough\n\nEnables strikethrough of text by enclosing it in `~~`. For example, in\n`hey ~~you~~`, `you` will be rendered as strikethrough text.\n\nUse class `StrikethroughExtension` in artifact `commonmark-ext-gfm-strikethrough`.\n\n### Tables\n\nEnables tables using pipes as in [GitHub Flavored Markdown][gfm-tables].\n\nUse class `TablesExtension` in artifact `commonmark-ext-gfm-tables`.\n\n### Footnotes\n\nEnables footnotes like in [GitHub](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#footnotes)\nor [Pandoc](https://pandoc.org/MANUAL.html#footnotes):\n\n```\nMain text[^1]\n\n[^1]: Additional text in a footnote\n```\n\nInline footnotes like `^[inline footnote]` are also supported when enabled via `FootnotesExtension.Builder#inlineFootnotes`.\n\nUse class `FootnotesExtension` in artifact `commonmark-ext-footnotes`.\n\n### Heading anchor\n\nEnables adding auto generated \"id\" attributes to heading tags. The \"id\"\nis based on the text of the heading.\n\n`# Heading` will be rendered as:\n\n```\n\u003ch1 id=\"heading\"\u003eHeading\u003c/h1\u003e\n```\n\nUse class `HeadingAnchorExtension` in artifact `commonmark-ext-heading-anchor`.\n\nIn case you want custom rendering of the heading instead, you can use\nthe `IdGenerator` class directly together with a\n`HtmlNodeRendererFactory` (see example above).\n\n### Ins\n\nEnables underlining of text by enclosing it in `++`. For example, in\n`hey ++you++`, `you` will be rendered as underline text. Uses the \u0026lt;ins\u0026gt; tag.\n\nUse class `InsExtension` in artifact `commonmark-ext-ins`.\n\n### YAML front matter\n\nAdds support for metadata through a YAML front matter block. This extension only supports a subset of YAML syntax. Here's an example of what's supported:\n\n```\n---\nkey: value\nlist:\n  - value 1\n  - value 2\nliteral: |\n  this is literal value.\n\n  literal values 2\n---\n\ndocument start here\n```\n\nUse class `YamlFrontMatterExtension` in artifact `commonmark-ext-yaml-front-matter`. To fetch metadata, use `YamlFrontMatterVisitor`.\n\n### Image Attributes\n\nAdds support for specifying attributes (specifically height and width) for images.\n\nThe attribute elements are given as `key=value` pairs inside curly braces `{ }` after the image node to which they apply,\nfor example:\n```\n![text](/url.png){width=640 height=480}\n```\nwill be rendered as:\n```\n\u003cimg src=\"/url.png\" alt=\"text\" width=\"640\" height=\"480\" /\u003e\n```\n\nUse class `ImageAttributesExtension` in artifact `commonmark-ext-image-attributes`.\n\nNote: since this extension uses curly braces `{` `}` as its delimiters (in `StylesDelimiterProcessor`), this means that\nother delimiter processors *cannot* use curly braces for delimiting.\n\n### Task List Items\n\nAdds support for tasks as list items.\n\nA task can be represented as a list item where the first non-whitespace character is a left bracket `[`, then a single\nwhitespace character or the letter `x` in lowercase or uppercase, then a right bracket `]` followed by at least one\nwhitespace before any other content.\n\nFor example:\n```\n- [ ] task #1\n- [x] task #2\n```\nwill be rendered as:\n```\n\u003cul\u003e\n\u003cli\u003e\u003cinput type=\"checkbox\" disabled=\"\"\u003e task #1\u003c/li\u003e\n\u003cli\u003e\u003cinput type=\"checkbox\" disabled=\"\" checked=\"\"\u003e task #2\u003c/li\u003e\n\u003c/ul\u003e\n```\n\nUse class `TaskListItemsExtension` in artifact `commonmark-ext-task-list-items`.\n\n### Third-party extensions\n\nYou can also find other extensions in the wild:\n\n* [commonmark-ext-notifications](https://github.com/McFoggy/commonmark-ext-notifications): this extension allows to easily create notifications/admonitions paragraphs like `INFO`, `SUCCESS`, `WARNING` or `ERROR`\n\nUsed by\n-------\n\nSome users of this library (feel free to raise a PR if you want to be added):\n* [Atlassian](https://www.atlassian.com/) (where the library was initially developed)\n* Java (OpenJDK) ([link](https://github.com/openjdk/jdk/blob/3895b8fc0b2c6d187080dba6fe08297adad4a480/src/jdk.internal.md/share/classes/module-info.java))\n* [Gerrit](https://www.gerritcodereview.com/) code review/Gitiles ([link](https://gerrit-review.googlesource.com/c/gitiles/+/353794))\n* [Clerk](https://clerk.vision/) moldable live programming for Clojure\n* [Znai](https://github.com/testingisdocumenting/znai)\n* [Open Note](https://github.com/YangDai2003/OpenNote-Compose) a markdown editor and note-taking app for Android\n* [Quarkus Roq](https://github.com/quarkiverse/quarkus-roq/) The Roq Static Site Generator allows to easily create a static website or blog using Quarkus super-powers.\n* [Lucee](https://github.com/lucee/lucee)\n* [Previewer](https://github.com/sebthom/previewer-eclipse-plugin) an extensible Eclipse plugin that previews Markdown and other text based formats.\n* [Xeres](https://xeres.io) a Peer-to-Peer application where all user generated content is done with markdown\n\nSee also\n--------\n\n* [Markwon](https://github.com/noties/Markwon): Android library for rendering markdown as system-native Spannables\n* [flexmark-java](https://github.com/vsch/flexmark-java): Fork that added support for a lot more syntax and flexibility\n\nContributing\n------------\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) file.\n\nLicense\n-------\n\nCopyright (c) 2015, Robin Stocker\n\nBSD (2-clause) licensed, see LICENSE.txt file.\n\n[CommonMark]: https://commonmark.org/\n[Markdown]: https://daringfireball.net/projects/markdown/\n[commonmark.js]: https://github.com/commonmark/commonmark.js\n[pegdown]: https://github.com/sirthias/pegdown\n[CommonMark Dingus]: https://spec.commonmark.org/dingus/\n[Maven Central]: https://search.maven.org/#search|ga|1|g%3A%22org.commonmark%22\n[Semantic Versioning]: https://semver.org/\n[autolink-java]: https://github.com/robinst/autolink-java\n[gfm-tables]: https://help.github.com/articles/organizing-information-with-tables/\n","funding_links":[],"categories":["Java","Markdown parser"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonmark%2Fcommonmark-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommonmark%2Fcommonmark-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonmark%2Fcommonmark-java/lists"}