├── .codecov.yml
├── .editorconfig
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
└── workflows
│ ├── ci.yml
│ └── release.yml
├── .gitignore
├── .mvn
└── wrapper
│ └── maven-wrapper.properties
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE.txt
├── README.md
├── commonmark-android-test
├── .gitignore
├── README.md
├── app
│ ├── build.gradle
│ ├── lint.xml
│ └── src
│ │ └── main
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── commonmark-ext-autolink
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── autolink
│ │ │ ├── AutolinkExtension.java
│ │ │ └── internal
│ │ │ └── AutolinkPostProcessor.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── autolink
│ └── AutolinkTest.java
├── commonmark-ext-footnotes
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── footnotes
│ │ │ ├── FootnoteDefinition.java
│ │ │ ├── FootnoteReference.java
│ │ │ ├── FootnotesExtension.java
│ │ │ ├── InlineFootnote.java
│ │ │ └── internal
│ │ │ ├── FootnoteBlockParser.java
│ │ │ ├── FootnoteHtmlNodeRenderer.java
│ │ │ ├── FootnoteLinkProcessor.java
│ │ │ └── FootnoteMarkdownNodeRenderer.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ ├── java
│ └── org
│ │ └── commonmark
│ │ └── ext
│ │ └── footnotes
│ │ ├── FootnoteHtmlRendererTest.java
│ │ ├── FootnoteMarkdownRendererTest.java
│ │ └── FootnotesTest.java
│ └── resources
│ └── footnotes.html
├── commonmark-ext-gfm-strikethrough
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── gfm
│ │ │ └── strikethrough
│ │ │ ├── Strikethrough.java
│ │ │ ├── StrikethroughExtension.java
│ │ │ └── internal
│ │ │ ├── StrikethroughDelimiterProcessor.java
│ │ │ ├── StrikethroughHtmlNodeRenderer.java
│ │ │ ├── StrikethroughMarkdownNodeRenderer.java
│ │ │ ├── StrikethroughNodeRenderer.java
│ │ │ └── StrikethroughTextContentNodeRenderer.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── gfm
│ └── strikethrough
│ ├── StrikethroughMarkdownRendererTest.java
│ ├── StrikethroughSpecTest.java
│ └── StrikethroughTest.java
├── commonmark-ext-gfm-tables
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── gfm
│ │ │ └── tables
│ │ │ ├── TableBlock.java
│ │ │ ├── TableBody.java
│ │ │ ├── TableCell.java
│ │ │ ├── TableHead.java
│ │ │ ├── TableRow.java
│ │ │ ├── TablesExtension.java
│ │ │ └── internal
│ │ │ ├── TableBlockParser.java
│ │ │ ├── TableHtmlNodeRenderer.java
│ │ │ ├── TableMarkdownNodeRenderer.java
│ │ │ ├── TableNodeRenderer.java
│ │ │ └── TableTextContentNodeRenderer.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── gfm
│ └── tables
│ ├── TableMarkdownRendererTest.java
│ ├── TablesSpecTest.java
│ ├── TablesTest.java
│ └── TablesTextContentTest.java
├── commonmark-ext-heading-anchor
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── heading
│ │ │ └── anchor
│ │ │ ├── HeadingAnchorExtension.java
│ │ │ ├── IdGenerator.java
│ │ │ └── internal
│ │ │ └── HeadingIdAttributeProvider.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── heading
│ └── anchor
│ ├── HeadingAnchorConfigurationTest.java
│ └── HeadingAnchorTest.java
├── commonmark-ext-image-attributes
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── image
│ │ │ └── attributes
│ │ │ ├── ImageAttributes.java
│ │ │ ├── ImageAttributesExtension.java
│ │ │ └── internal
│ │ │ ├── ImageAttributesAttributeProvider.java
│ │ │ └── ImageAttributesDelimiterProcessor.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── image
│ └── attributes
│ └── ImageAttributesTest.java
├── commonmark-ext-ins
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── ins
│ │ │ ├── Ins.java
│ │ │ ├── InsExtension.java
│ │ │ └── internal
│ │ │ ├── InsDelimiterProcessor.java
│ │ │ ├── InsHtmlNodeRenderer.java
│ │ │ ├── InsMarkdownNodeRenderer.java
│ │ │ ├── InsNodeRenderer.java
│ │ │ └── InsTextContentNodeRenderer.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── ins
│ ├── InsMarkdownRendererTest.java
│ └── InsTest.java
├── commonmark-ext-task-list-items
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── task
│ │ │ └── list
│ │ │ └── items
│ │ │ ├── TaskListItemMarker.java
│ │ │ ├── TaskListItemsExtension.java
│ │ │ └── internal
│ │ │ ├── TaskListItemHtmlNodeRenderer.java
│ │ │ └── TaskListItemPostProcessor.java
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── task
│ └── list
│ └── items
│ └── TaskListItemsTest.java
├── commonmark-ext-yaml-front-matter
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── ext
│ │ │ └── front
│ │ │ └── matter
│ │ │ ├── YamlFrontMatterBlock.java
│ │ │ ├── YamlFrontMatterExtension.java
│ │ │ ├── YamlFrontMatterNode.java
│ │ │ ├── YamlFrontMatterVisitor.java
│ │ │ └── internal
│ │ │ └── YamlFrontMatterBlockParser.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ └── ext
│ └── front
│ └── matter
│ └── YamlFrontMatterTest.java
├── commonmark-integration-test
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── commonmark
│ │ │ └── integration
│ │ │ └── IntegrationTests.java
│ └── resources
│ │ └── META-INF
│ │ └── LICENSE.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ ├── integration
│ ├── BoundsIntegrationTest.java
│ ├── Extensions.java
│ ├── ExtensionsIntegrationTest.java
│ ├── MarkdownRendererIntegrationTest.java
│ ├── PegDownBenchmark.java
│ ├── SourceSpanIntegrationTest.java
│ └── SpecIntegrationTest.java
│ └── ui
│ └── DingusApp.java
├── commonmark-test-util
├── pom.xml
└── src
│ └── main
│ ├── java
│ ├── module-info.java
│ └── org
│ │ └── commonmark
│ │ └── testutil
│ │ ├── Asserts.java
│ │ ├── RenderingTestCase.java
│ │ ├── SpecTestCase.java
│ │ ├── TestResources.java
│ │ └── example
│ │ ├── Example.java
│ │ └── ExampleReader.java
│ └── resources
│ ├── META-INF
│ └── LICENSE.txt
│ ├── README.md
│ ├── cmark-regression.txt
│ ├── commonmark.js-regression.txt
│ ├── gfm-spec.txt
│ └── spec.txt
├── commonmark
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ ├── module-info.java
│ │ └── org
│ │ │ └── commonmark
│ │ │ ├── Extension.java
│ │ │ ├── internal
│ │ │ ├── BlockContent.java
│ │ │ ├── BlockContinueImpl.java
│ │ │ ├── BlockQuoteParser.java
│ │ │ ├── BlockStartImpl.java
│ │ │ ├── Bracket.java
│ │ │ ├── Definitions.java
│ │ │ ├── Delimiter.java
│ │ │ ├── DocumentBlockParser.java
│ │ │ ├── DocumentParser.java
│ │ │ ├── FencedCodeBlockParser.java
│ │ │ ├── HeadingParser.java
│ │ │ ├── HtmlBlockParser.java
│ │ │ ├── IndentedCodeBlockParser.java
│ │ │ ├── InlineParserContextImpl.java
│ │ │ ├── InlineParserImpl.java
│ │ │ ├── LinkReferenceDefinitionParser.java
│ │ │ ├── ListBlockParser.java
│ │ │ ├── ListItemParser.java
│ │ │ ├── ParagraphParser.java
│ │ │ ├── StaggeredDelimiterProcessor.java
│ │ │ ├── ThematicBreakParser.java
│ │ │ ├── inline
│ │ │ │ ├── AsteriskDelimiterProcessor.java
│ │ │ │ ├── AutolinkInlineParser.java
│ │ │ │ ├── BackslashInlineParser.java
│ │ │ │ ├── BackticksInlineParser.java
│ │ │ │ ├── CoreLinkProcessor.java
│ │ │ │ ├── EmphasisDelimiterProcessor.java
│ │ │ │ ├── EntityInlineParser.java
│ │ │ │ ├── HtmlInlineParser.java
│ │ │ │ ├── LinkResultImpl.java
│ │ │ │ ├── ParsedInlineImpl.java
│ │ │ │ └── UnderscoreDelimiterProcessor.java
│ │ │ ├── renderer
│ │ │ │ ├── NodeRendererMap.java
│ │ │ │ └── text
│ │ │ │ │ ├── BulletListHolder.java
│ │ │ │ │ ├── ListHolder.java
│ │ │ │ │ └── OrderedListHolder.java
│ │ │ └── util
│ │ │ │ ├── Escaping.java
│ │ │ │ ├── Html5Entities.java
│ │ │ │ ├── LineReader.java
│ │ │ │ ├── LinkScanner.java
│ │ │ │ └── Parsing.java
│ │ │ ├── node
│ │ │ ├── AbstractVisitor.java
│ │ │ ├── Block.java
│ │ │ ├── BlockQuote.java
│ │ │ ├── BulletList.java
│ │ │ ├── Code.java
│ │ │ ├── CustomBlock.java
│ │ │ ├── CustomNode.java
│ │ │ ├── DefinitionMap.java
│ │ │ ├── Delimited.java
│ │ │ ├── Document.java
│ │ │ ├── Emphasis.java
│ │ │ ├── FencedCodeBlock.java
│ │ │ ├── HardLineBreak.java
│ │ │ ├── Heading.java
│ │ │ ├── HtmlBlock.java
│ │ │ ├── HtmlInline.java
│ │ │ ├── Image.java
│ │ │ ├── IndentedCodeBlock.java
│ │ │ ├── Link.java
│ │ │ ├── LinkReferenceDefinition.java
│ │ │ ├── ListBlock.java
│ │ │ ├── ListItem.java
│ │ │ ├── Node.java
│ │ │ ├── Nodes.java
│ │ │ ├── OrderedList.java
│ │ │ ├── Paragraph.java
│ │ │ ├── SoftLineBreak.java
│ │ │ ├── SourceSpan.java
│ │ │ ├── SourceSpans.java
│ │ │ ├── StrongEmphasis.java
│ │ │ ├── Text.java
│ │ │ ├── ThematicBreak.java
│ │ │ ├── Visitor.java
│ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── parser
│ │ │ ├── IncludeSourceSpans.java
│ │ │ ├── InlineParser.java
│ │ │ ├── InlineParserContext.java
│ │ │ ├── InlineParserFactory.java
│ │ │ ├── Parser.java
│ │ │ ├── PostProcessor.java
│ │ │ ├── SourceLine.java
│ │ │ ├── SourceLines.java
│ │ │ ├── beta
│ │ │ │ ├── InlineContentParser.java
│ │ │ │ ├── InlineContentParserFactory.java
│ │ │ │ ├── InlineParserState.java
│ │ │ │ ├── LinkInfo.java
│ │ │ │ ├── LinkProcessor.java
│ │ │ │ ├── LinkResult.java
│ │ │ │ ├── ParsedInline.java
│ │ │ │ ├── Position.java
│ │ │ │ ├── Scanner.java
│ │ │ │ └── package-info.java
│ │ │ ├── block
│ │ │ │ ├── AbstractBlockParser.java
│ │ │ │ ├── AbstractBlockParserFactory.java
│ │ │ │ ├── BlockContinue.java
│ │ │ │ ├── BlockParser.java
│ │ │ │ ├── BlockParserFactory.java
│ │ │ │ ├── BlockStart.java
│ │ │ │ ├── MatchedBlockParser.java
│ │ │ │ ├── ParserState.java
│ │ │ │ └── package-info.java
│ │ │ ├── delimiter
│ │ │ │ ├── DelimiterProcessor.java
│ │ │ │ └── DelimiterRun.java
│ │ │ └── package-info.java
│ │ │ ├── renderer
│ │ │ ├── NodeRenderer.java
│ │ │ ├── Renderer.java
│ │ │ ├── html
│ │ │ │ ├── AttributeProvider.java
│ │ │ │ ├── AttributeProviderContext.java
│ │ │ │ ├── AttributeProviderFactory.java
│ │ │ │ ├── CoreHtmlNodeRenderer.java
│ │ │ │ ├── DefaultUrlSanitizer.java
│ │ │ │ ├── HtmlNodeRendererContext.java
│ │ │ │ ├── HtmlNodeRendererFactory.java
│ │ │ │ ├── HtmlRenderer.java
│ │ │ │ ├── HtmlWriter.java
│ │ │ │ ├── UrlSanitizer.java
│ │ │ │ └── package-info.java
│ │ │ ├── markdown
│ │ │ │ ├── CoreMarkdownNodeRenderer.java
│ │ │ │ ├── MarkdownNodeRendererContext.java
│ │ │ │ ├── MarkdownNodeRendererFactory.java
│ │ │ │ ├── MarkdownRenderer.java
│ │ │ │ ├── MarkdownWriter.java
│ │ │ │ └── package-info.java
│ │ │ └── text
│ │ │ │ ├── CoreTextContentNodeRenderer.java
│ │ │ │ ├── LineBreakRendering.java
│ │ │ │ ├── TextContentNodeRendererContext.java
│ │ │ │ ├── TextContentNodeRendererFactory.java
│ │ │ │ ├── TextContentRenderer.java
│ │ │ │ ├── TextContentWriter.java
│ │ │ │ └── package-info.java
│ │ │ └── text
│ │ │ ├── AsciiMatcher.java
│ │ │ ├── CharMatcher.java
│ │ │ ├── Characters.java
│ │ │ └── package-info.java
│ ├── javadoc
│ │ └── overview.html
│ └── resources
│ │ ├── META-INF
│ │ └── LICENSE.txt
│ │ └── org
│ │ └── commonmark
│ │ └── internal
│ │ └── util
│ │ └── entities.txt
│ └── test
│ └── java
│ └── org
│ └── commonmark
│ ├── ProfilingMain.java
│ ├── internal
│ ├── DocumentParserTest.java
│ ├── LinkReferenceDefinitionParserTest.java
│ └── util
│ │ ├── EscapingTest.java
│ │ └── LineReaderTest.java
│ ├── parser
│ ├── InlineContentParserTest.java
│ └── beta
│ │ ├── LinkProcessorTest.java
│ │ └── ScannerTest.java
│ ├── renderer
│ └── markdown
│ │ ├── MarkdownRendererTest.java
│ │ └── SpecMarkdownRendererTest.java
│ ├── test
│ ├── AbstractVisitorTest.java
│ ├── CoreRenderingTestCase.java
│ ├── DelimitedTest.java
│ ├── DelimiterProcessorTest.java
│ ├── FencedCodeBlockParserTest.java
│ ├── HeadingParserTest.java
│ ├── HtmlInlineParserTest.java
│ ├── HtmlRendererTest.java
│ ├── InlineParserContextTest.java
│ ├── LinkReferenceDefinitionNodeTest.java
│ ├── ListBlockParserTest.java
│ ├── ListTightLooseTest.java
│ ├── Nodes.java
│ ├── ParserTest.java
│ ├── PathologicalTest.java
│ ├── RegressionTest.java
│ ├── SourceLineTest.java
│ ├── SourceSpanRenderer.java
│ ├── SourceSpanTest.java
│ ├── SourceSpansTest.java
│ ├── SpecBenchmark.java
│ ├── SpecCoreTest.java
│ ├── SpecCrLfCoreTest.java
│ ├── SpecialInputTest.java
│ ├── TextContentRendererTest.java
│ ├── TextContentWriterTest.java
│ ├── ThematicBreakParserTest.java
│ └── UsageExampleTest.java
│ └── text
│ └── CharactersTest.java
├── etc
├── benchmark.sh
├── entities.js
└── update-spec.sh
├── mvnw
├── pom.xml
└── renovate.json
/.codecov.yml:
--------------------------------------------------------------------------------
1 | comment:
2 | layout: "diff, flags, files"
3 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | end_of_line = lf
5 | insert_final_newline = true
6 | charset = utf-8
7 |
8 | [*.java]
9 | indent_style = space
10 | indent_size = 4
11 | continuation_indent_size = 8
12 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Some input not render as you expect? Include an example so we can help
4 | title: ''
5 | labels: bug
6 | assignees: ''
7 |
8 | ---
9 |
10 | Steps to reproduce the problem (provide example Markdown if applicable):
11 |
12 | ```
13 | my markdown
14 | ```
15 |
16 | Expected behavior:
17 |
18 | ```
19 | expected HTML
20 | ```
21 |
22 | Actual behavior:
23 |
24 | ```
25 | actual HTML
26 | ```
27 |
28 | (Also see what the reference implementation does: https://spec.commonmark.org/dingus/)
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: enhancement
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen. Include source code if possible.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context about the feature request here.
21 |
--------------------------------------------------------------------------------
/.github/workflows/ci.yml:
--------------------------------------------------------------------------------
1 | # See https://docs.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-maven
2 |
3 | name: ci
4 |
5 | on: [push, pull_request]
6 |
7 | jobs:
8 | build:
9 | runs-on: ubuntu-latest
10 | strategy:
11 | matrix:
12 | java: [11, 17, 21, 23]
13 | steps:
14 | - name: Checkout sources
15 | uses: actions/checkout@v4
16 |
17 | - name: Set up JDK
18 | uses: actions/setup-java@v4
19 | with:
20 | java-version: ${{ matrix.java }}
21 | distribution: 'zulu'
22 |
23 | - name: Build
24 | run: mvn -B package javadoc:javadoc
25 |
26 | coverage:
27 | runs-on: ubuntu-latest
28 | if: ${{ github.event_name == 'push' }}
29 | steps:
30 | - name: Checkout sources
31 | uses: actions/checkout@v4
32 |
33 | - name: Set up JDK
34 | uses: actions/setup-java@v4
35 | with:
36 | java-version: 11
37 | distribution: 'zulu'
38 |
39 | - name: Build with coverage
40 | run: mvn -B -Pcoverage clean test jacoco:report-aggregate
41 |
42 | - name: Publish coverage
43 | uses: codecov/codecov-action@v4
44 | with:
45 | fail_ci_if_error: true
46 | token: ${{ secrets.CODECOV_TOKEN }}
47 |
48 | android-compatibility:
49 | runs-on: ubuntu-latest
50 | steps:
51 | - name: Checkout sources
52 | uses: actions/checkout@v4
53 |
54 | - name: Set up JDK
55 | uses: actions/setup-java@v4
56 | with:
57 | java-version: 11
58 | distribution: 'zulu'
59 |
60 | - name: Android Lint checks
61 | run: cd commonmark-android-test && ./gradlew :app:lint
62 |
--------------------------------------------------------------------------------
/.github/workflows/release.yml:
--------------------------------------------------------------------------------
1 | # See:
2 | # https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-java-packages-with-maven
3 | # https://central.sonatype.org/pages/apache-maven.html
4 | # https://github.com/actions/setup-java
5 |
6 | name: release
7 |
8 | on:
9 | workflow_dispatch:
10 |
11 | jobs:
12 | release:
13 | environment: maven_central
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Checkout sources
17 | uses: actions/checkout@v4
18 |
19 | - name: Set up Maven Central repository
20 | uses: actions/setup-java@v4
21 | with:
22 | java-version: 11
23 | distribution: 'zulu'
24 | server-id: ossrh
25 | server-username: MAVEN_USERNAME # env variable to use for username in release
26 | server-password: MAVEN_PASSWORD # env variable to use for password in release
27 | gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
28 | gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable to use for passphrase in release
29 |
30 | - name: Set up Git user
31 | run: |
32 | git config --global user.name "${{ secrets.GIT_USER_NAME }}"
33 | git config --global user.email "${{ secrets.GIT_USER_EMAIL }}"
34 |
35 | - name: Release
36 | run: |
37 | mvn -B -Dusername=${{ secrets.GH_USERNAME }} -Dpassword=${{ secrets.GH_ACCESS_TOKEN }} release:prepare
38 | mvn -B release:perform
39 | env:
40 | MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
41 | MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
42 | MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
43 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Eclipse
2 | .project
3 | .classpath
4 | .settings/
5 |
6 | # IntelliJ IDEA
7 | .idea
8 | *.iml
9 |
10 | # Maven
11 | target/
12 |
13 | # macOS
14 | .DS_Store
15 |
--------------------------------------------------------------------------------
/.mvn/wrapper/maven-wrapper.properties:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one
2 | # or more contributor license agreements. See the NOTICE file
3 | # distributed with this work for additional information
4 | # regarding copyright ownership. The ASF licenses this file
5 | # to you under the Apache License, Version 2.0 (the
6 | # "License"); you may not use this file except in compliance
7 | # with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing,
12 | # software distributed under the License is distributed on an
13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | # KIND, either express or implied. See the License for the
15 | # specific language governing permissions and limitations
16 | # under the License.
17 | wrapperVersion=3.3.2
18 | distributionType=only-script
19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
20 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Contributing
2 | ============
3 |
4 | Hey, thanks for your interest in contributing to this library! We welcome any
5 | type of pull request, issues and comments! 😀
6 |
7 | For pull requests, make sure you:
8 |
9 | * Add tests for new features and bug fixes
10 | * Follow the existing style (always use braces, 4 space indent)
11 | * Separate unrelated changes into multiple pull requests
12 |
13 | If you are interested in working on something but don't know what, see the
14 | existing issues with label "help wanted".
15 |
16 | For bigger changes, make sure you start a discussion first by creating
17 | an issue and explaining the intended change.
18 |
19 | The [sourcespy dashboard](https://sourcespy.com/github/commonmarkcommonmarkjava/)
20 | provides a high level overview of the repository including
21 | [class diagram](https://sourcespy.com/github/commonmarkcommonmarkjava/xx-omodel-.html),
22 | [module dependencies](https://sourcespy.com/github/commonmarkcommonmarkjava/xx-omodulesc-.html),
23 | [module hierarchy](https://sourcespy.com/github/commonmarkcommonmarkjava/xx-omodules-.html),
24 | [external libraries](https://sourcespy.com/github/commonmarkcommonmarkjava/xx-ojavalibs-.html),
25 | and other components of the system.
26 |
27 | Releasing
28 | ---------
29 |
30 | Releases are done from the "release" workflow on GitHub Actions.
31 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015, Robin Stocker
2 | All rights reserved.
3 |
4 | Redistribution and use in source and binary forms, with or without
5 | modification, are permitted provided that the following conditions are met:
6 |
7 | * Redistributions of source code must retain the above copyright notice, this
8 | list of conditions and the following disclaimer.
9 |
10 | * Redistributions in binary form must reproduce the above copyright notice,
11 | this list of conditions and the following disclaimer in the documentation
12 | and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 |
--------------------------------------------------------------------------------
/commonmark-android-test/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | local.properties
3 | test.properties
4 | gradle.properties
5 | build
6 |
--------------------------------------------------------------------------------
/commonmark-android-test/README.md:
--------------------------------------------------------------------------------
1 | commonmark-android-test
2 | =======================
3 |
4 | This module ensures that commonmark-java is supported on Android by running `lint` checks on library sources.
5 | Current `minSdk` is 19
6 |
7 | Requirements:
8 |
9 | * Java 11 or above
10 | * Android SDK 30
11 |
12 | Configuration
13 | -----
14 |
15 | 1. Download Android SDK
16 | 2. Be sure that SDK Platform 30 is installed. It's recommended to use x86
17 | 3. Export to PATH: `path_to_android_sdk/platform-tools` and `path_to_android_sdk/tools`
18 | 4. Create 2 properties files in commonmark-android-test
19 |
20 | /local.properties
21 | ```properties
22 | sdk.dir=/path_to_android_sdk
23 | ```
24 |
25 | Usage
26 | -----
27 |
28 | #### Run lint checked
29 |
30 | on Mac/Linux:
31 | ```shell
32 | ./gradlew :app:lint
33 | ```
34 |
35 | on Windows:
36 | ```bat
37 | .\gradlew :app:lint
38 | ```
39 |
40 | Links
41 | -----
42 | [Gradle Documentations](https://docs.gradle.org/current/userguide/userguide.html)
43 | [Android Gradle Plugin Docs](http://tools.android.com/tech-docs/new-build-system)
44 |
--------------------------------------------------------------------------------
/commonmark-android-test/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | namespace "org.commonmark.android.test"
5 | compileSdk 30
6 |
7 | defaultConfig {
8 | applicationId "org.commonmark.android.test"
9 | minSdk 19
10 | targetSdk 30
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 |
15 | compileOptions {
16 | sourceCompatibility JavaVersion.VERSION_11
17 | targetCompatibility JavaVersion.VERSION_11
18 | }
19 |
20 | packagingOptions {
21 | exclude 'META-INF/LICENSE'
22 | exclude 'META-INF/LICENSE.txt'
23 | exclude 'META-INF/NOTICE'
24 | exclude 'META-INF/NOTICE.txt'
25 | }
26 |
27 | // we add other modules sources in order for lint to process them (lint operates on sources)
28 | sourceSets {
29 | main {
30 | java {
31 | [
32 | '../../commonmark',
33 | '../../commonmark-ext-autolink',
34 | '../../commonmark-ext-gfm-strikethrough',
35 | '../../commonmark-ext-gfm-tables',
36 | '../../commonmark-ext-heading-anchor',
37 | '../../commonmark-ext-ins',
38 | '../../commonmark-ext-yaml-front-matter'
39 | ].forEach { d ->
40 | // don't include module-info files, otherwise we get
41 | // "too many module declarations found"
42 | PatternSet patternSet = new PatternSet().exclude('**/module-info.java')
43 | srcDirs += fileTree("$d/src/main/java").matching(patternSet)
44 | }
45 | }
46 | }
47 | }
48 | }
49 |
50 | dependencies {
51 | implementation('org.nibor.autolink:autolink:0.11.0')
52 | }
53 |
--------------------------------------------------------------------------------
/commonmark-android-test/app/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 | * Create it with {@link #create()} and then configure it on the builders 12 | * ({@link org.commonmark.parser.Parser.Builder#extensions(Iterable)}, 13 | * {@link HtmlRenderer.Builder#extensions(Iterable)}). 14 | *
15 | *16 | * The parsed links are turned into normal {@link org.commonmark.node.Link} nodes. 17 | *
18 | */ 19 | public class AutolinkExtension implements Parser.ParserExtension { 20 | 21 | private AutolinkExtension() { 22 | } 23 | 24 | public static Extension create() { 25 | return new AutolinkExtension(); 26 | } 27 | 28 | @Override 29 | public void extend(Parser.Builder parserBuilder) { 30 | parserBuilder.postProcessor(new AutolinkPostProcessor()); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /commonmark-ext-autolink/src/main/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Extension for automatically turning plain URLs and email addresses into links 4 |See {@link org.commonmark.ext.autolink.AutolinkExtension}
5 | 6 | 7 | -------------------------------------------------------------------------------- /commonmark-ext-autolink/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Atlassian Pty Ltd 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /commonmark-ext-footnotes/pom.xml: -------------------------------------------------------------------------------- 1 | 2 |
8 | * [^foo]: This is the footnote text
9 | *
10 | * The {@link #getLabel() label} is the text in brackets after {@code ^}, so {@code foo} in the example. The contents
11 | * of the footnote are child nodes of the definition, a {@link org.commonmark.node.Paragraph} in the example.
12 | *
13 | * Footnote definitions are parsed even if there's no corresponding {@link FootnoteReference}.
14 | */
15 | public class FootnoteDefinition extends CustomBlock {
16 |
17 | private String label;
18 |
19 | public FootnoteDefinition(String label) {
20 | this.label = label;
21 | }
22 |
23 | public String getLabel() {
24 | return label;
25 | }
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/commonmark-ext-footnotes/src/main/java/org/commonmark/ext/footnotes/FootnoteReference.java:
--------------------------------------------------------------------------------
1 | package org.commonmark.ext.footnotes;
2 |
3 | import org.commonmark.node.CustomNode;
4 |
5 | /**
6 | * A footnote reference, e.g. [^foo]
in Some text with a footnote[^foo]
7 | *
8 | * The {@link #getLabel() label} is the text within brackets after {@code ^}, so {@code foo} in the example. It needs to 9 | * match the label of a corresponding {@link FootnoteDefinition} for the footnote to be parsed. 10 | */ 11 | public class FootnoteReference extends CustomNode { 12 | private String label; 13 | 14 | public FootnoteReference(String label) { 15 | this.label = label; 16 | } 17 | 18 | public String getLabel() { 19 | return label; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /commonmark-ext-footnotes/src/main/java/org/commonmark/ext/footnotes/InlineFootnote.java: -------------------------------------------------------------------------------- 1 | package org.commonmark.ext.footnotes; 2 | 3 | import org.commonmark.node.CustomNode; 4 | 5 | public class InlineFootnote extends CustomNode { 6 | } 7 | -------------------------------------------------------------------------------- /commonmark-ext-footnotes/src/main/javadoc/overview.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | Extension for footnotes using [^1] syntax 4 |See {@link org.commonmark.ext.footnotes.FootnotesExtension}
5 | 6 | 7 | -------------------------------------------------------------------------------- /commonmark-ext-footnotes/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Atlassian Pty Ltd 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /commonmark-ext-footnotes/src/test/java/org/commonmark/ext/footnotes/FootnoteMarkdownRendererTest.java: -------------------------------------------------------------------------------- 1 | package org.commonmark.ext.footnotes; 2 | 3 | import org.commonmark.Extension; 4 | import org.commonmark.node.Node; 5 | import org.commonmark.parser.Parser; 6 | import org.commonmark.renderer.markdown.MarkdownRenderer; 7 | import org.junit.Test; 8 | 9 | import java.util.Set; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | public class FootnoteMarkdownRendererTest { 14 | private static final SetSee {@link org.commonmark.ext.gfm.strikethrough.StrikethroughExtension}
5 | 6 | 7 | -------------------------------------------------------------------------------- /commonmark-ext-gfm-strikethrough/src/main/resources/META-INF/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Atlassian Pty Ltd 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /commonmark-ext-gfm-strikethrough/src/test/java/org/commonmark/ext/gfm/strikethrough/StrikethroughMarkdownRendererTest.java: -------------------------------------------------------------------------------- 1 | package org.commonmark.ext.gfm.strikethrough; 2 | 3 | import org.commonmark.Extension; 4 | import org.commonmark.parser.Parser; 5 | import org.commonmark.renderer.markdown.MarkdownRenderer; 6 | import org.junit.Test; 7 | 8 | import java.util.Set; 9 | 10 | import static org.junit.Assert.assertEquals; 11 | 12 | public class StrikethroughMarkdownRendererTest { 13 | 14 | private static final Set