├── .devcontainer
└── devcontainer.json
├── .editorconfig
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE.md
├── ISSUE_TEMPLATE
│ ├── Bug_report.md
│ ├── Feature_request.md
│ └── Proposal.md
├── PULL_REQUEST_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE
│ └── badges.md
├── dependabot.yml
└── workflows
│ └── tests.yml
├── .gitignore
├── .releaserc.json
├── CHANGELOG.md
├── LICENSE.md
├── README.md
├── SECURITY.md
├── api
└── dingus.js
├── bin
├── main.js
└── marked.js
├── docs
├── .eslintrc.json
├── AUTHORS.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── INDEX.md
├── PUBLISHING.md
├── USING_ADVANCED.md
├── USING_PRO.md
├── _document.html
├── broken.md
├── build.js
├── css
│ ├── hljs-github.css
│ ├── shared.css
│ └── style.css
├── demo
│ ├── demo.css
│ ├── demo.js
│ ├── index.html
│ ├── initial.md
│ ├── preview.html
│ ├── quickref.md
│ └── worker.js
├── favicon.ico
├── img
│ ├── copy-icon.svg
│ ├── logo-black-and-white.svg
│ └── logo-black.svg
└── js
│ └── index.js
├── esbuild.config.js
├── eslint.config.js
├── man
└── marked.1.md
├── package-lock.json
├── package.json
├── src
├── Hooks.ts
├── Instance.ts
├── Lexer.ts
├── MarkedOptions.ts
├── Parser.ts
├── Renderer.ts
├── TextRenderer.ts
├── Tokenizer.ts
├── Tokens.ts
├── defaults.ts
├── helpers.ts
├── marked.ts
└── rules.ts
├── test
├── .eslintrc.json
├── bench.js
├── cjs-test.cjs
├── recheck.js
├── rules.js
├── run-spec-tests.js
├── specs
│ ├── commonmark
│ │ └── commonmark.0.31.2.json
│ ├── gfm
│ │ ├── commonmark.0.31.2.json
│ │ └── gfm.0.29.json
│ ├── new
│ │ ├── adjacent_lists.html
│ │ ├── adjacent_lists.md
│ │ ├── autolink_after_link.html
│ │ ├── autolink_after_link.md
│ │ ├── autolink_lines.html
│ │ ├── autolink_lines.md
│ │ ├── autolinks.html
│ │ ├── autolinks.md
│ │ ├── autolinks_quotes.html
│ │ ├── autolinks_quotes.md
│ │ ├── blockquote_following_nptable.html
│ │ ├── blockquote_following_nptable.md
│ │ ├── blockquote_following_table.html
│ │ ├── blockquote_following_table.md
│ │ ├── blockquote_list_item.html
│ │ ├── blockquote_list_item.md
│ │ ├── blockquote_setext.html
│ │ ├── blockquote_setext.md
│ │ ├── breakline.html
│ │ ├── breakline.md
│ │ ├── breaks.html
│ │ ├── breaks.md
│ │ ├── case_insensitive_refs.html
│ │ ├── case_insensitive_refs.md
│ │ ├── code_block_no_ending_newline.html
│ │ ├── code_block_no_ending_newline.md
│ │ ├── code_compensation_indent.html
│ │ ├── code_compensation_indent.md
│ │ ├── code_consistent_newline.html
│ │ ├── code_consistent_newline.md
│ │ ├── code_following_nptable.html
│ │ ├── code_following_nptable.md
│ │ ├── code_following_table.html
│ │ ├── code_following_table.md
│ │ ├── code_spans.html
│ │ ├── code_spans.md
│ │ ├── codespan_newline.html
│ │ ├── codespan_newline.md
│ │ ├── def_blocks.html
│ │ ├── def_blocks.md
│ │ ├── del_strikethrough.html
│ │ ├── del_strikethrough.md
│ │ ├── double_link.html
│ │ ├── double_link.md
│ │ ├── em_2char.html
│ │ ├── em_2char.md
│ │ ├── em_after_inline.html
│ │ ├── em_after_inline.md
│ │ ├── em_and_reflinks.html
│ │ ├── em_and_reflinks.md
│ │ ├── em_list_links.html
│ │ ├── em_list_links.md
│ │ ├── em_strong_adjacent.html
│ │ ├── em_strong_adjacent.md
│ │ ├── em_strong_adjacent_mixed.html
│ │ ├── em_strong_adjacent_mixed.md
│ │ ├── em_strong_complex_nesting.html
│ │ ├── em_strong_complex_nesting.md
│ │ ├── em_strong_multiline.html
│ │ ├── em_strong_multiline.md
│ │ ├── em_strong_orphaned_nesting.html
│ │ ├── em_strong_orphaned_nesting.md
│ │ ├── email_after_space.html
│ │ ├── email_after_space.md
│ │ ├── emoji_inline.html
│ │ ├── emoji_inline.md
│ │ ├── emphasis_extra tests.html
│ │ ├── emphasis_extra tests.md
│ │ ├── empty_heading_following_paragraph.html
│ │ ├── empty_heading_following_paragraph.md
│ │ ├── empty_heading_following_paragraph_nogfm.html
│ │ ├── empty_heading_following_paragraph_nogfm.md
│ │ ├── empty_heading_following_table.html
│ │ ├── empty_heading_following_table.md
│ │ ├── escape_tick.html
│ │ ├── escape_tick.md
│ │ ├── escape_within_del.html
│ │ ├── escape_within_del.md
│ │ ├── escape_within_emphasis.html
│ │ ├── escape_within_emphasis.md
│ │ ├── escaped_angles.html
│ │ ├── escaped_angles.md
│ │ ├── fences_breaking_paragraphs.html
│ │ ├── fences_breaking_paragraphs.md
│ │ ├── fences_following_list.html
│ │ ├── fences_following_list.md
│ │ ├── fences_following_nptable.html
│ │ ├── fences_following_nptable.md
│ │ ├── fences_following_table.html
│ │ ├── fences_following_table.md
│ │ ├── fences_with_blankline_following_list_0.html
│ │ ├── fences_with_blankline_following_list_0.md
│ │ ├── fences_with_blankline_following_list_1.html
│ │ ├── fences_with_blankline_following_list_1.md
│ │ ├── heading_following_list.html
│ │ ├── heading_following_list.md
│ │ ├── heading_following_nptable.html
│ │ ├── heading_following_nptable.md
│ │ ├── heading_following_table.html
│ │ ├── heading_following_table.md
│ │ ├── hr_following_nptables.html
│ │ ├── hr_following_nptables.md
│ │ ├── hr_following_tables.html
│ │ ├── hr_following_tables.md
│ │ ├── hr_list_break.html
│ │ ├── hr_list_break.md
│ │ ├── html_comments.html
│ │ ├── html_comments.md
│ │ ├── html_following_list.html
│ │ ├── html_following_list.md
│ │ ├── html_following_nptable.html
│ │ ├── html_following_nptable.md
│ │ ├── html_following_table.html
│ │ ├── html_following_table.md
│ │ ├── html_no_new_line.html
│ │ ├── html_no_new_line.md
│ │ ├── image_links.html
│ │ ├── image_links.md
│ │ ├── image_paren.html
│ │ ├── image_paren.md
│ │ ├── incorrectly_formatted_list_and_hr.html
│ │ ├── incorrectly_formatted_list_and_hr.md
│ │ ├── indented_details.html
│ │ ├── indented_details.md
│ │ ├── indented_tables.html
│ │ ├── indented_tables.md
│ │ ├── inlinecode_following_nptables.html
│ │ ├── inlinecode_following_nptables.md
│ │ ├── inlinecode_following_tables.html
│ │ ├── inlinecode_following_tables.md
│ │ ├── lazy_blockquotes.html
│ │ ├── lazy_blockquotes.md
│ │ ├── lheading_following_nptable.html
│ │ ├── lheading_following_nptable.md
│ │ ├── lheading_following_table.html
│ │ ├── lheading_following_table.md
│ │ ├── link_lt.html
│ │ ├── link_lt.md
│ │ ├── link_tick_redos.html
│ │ ├── link_tick_redos.md
│ │ ├── link_unbalanced.html
│ │ ├── link_unbalanced.md
│ │ ├── links.html
│ │ ├── links.md
│ │ ├── links_paren.html
│ │ ├── links_paren.md
│ │ ├── list_align_number.html
│ │ ├── list_align_number.md
│ │ ├── list_align_pedantic.html
│ │ ├── list_align_pedantic.md
│ │ ├── list_code_header.html
│ │ ├── list_code_header.md
│ │ ├── list_following_nptable.html
│ │ ├── list_following_nptable.md
│ │ ├── list_following_table.html
│ │ ├── list_following_table.md
│ │ ├── list_item_tabs.html
│ │ ├── list_item_tabs.md
│ │ ├── list_item_text.html
│ │ ├── list_item_text.md
│ │ ├── list_item_unindented_asterisk.html
│ │ ├── list_item_unindented_asterisk.md
│ │ ├── list_loose.html
│ │ ├── list_loose.md
│ │ ├── list_loose_tasks.html
│ │ ├── list_loose_tasks.md
│ │ ├── list_paren_delimiter.html
│ │ ├── list_paren_delimiter.md
│ │ ├── list_table.html
│ │ ├── list_table.md
│ │ ├── list_tasks_non_gfm.html
│ │ ├── list_tasks_non_gfm.md
│ │ ├── list_with_line_break.html
│ │ ├── list_with_line_break.md
│ │ ├── multiple_sub_lists.html
│ │ ├── multiple_sub_lists.md
│ │ ├── nbsp_following_tables.html
│ │ ├── nbsp_following_tables.md
│ │ ├── nested_code.html
│ │ ├── nested_code.md
│ │ ├── nested_em.html
│ │ ├── nested_em.md
│ │ ├── nested_square_link.html
│ │ ├── nested_square_link.md
│ │ ├── nogfm_hashtag.html
│ │ ├── nogfm_hashtag.md
│ │ ├── not_a_link.html
│ │ ├── not_a_link.md
│ │ ├── paragraph-after-list-item.html
│ │ ├── paragraph-after-list-item.md
│ │ ├── pedantic_heading.html
│ │ ├── pedantic_heading.md
│ │ ├── pedantic_heading_interrupts_paragraph.html
│ │ ├── pedantic_heading_interrupts_paragraph.md
│ │ ├── ref_paren.html
│ │ ├── ref_paren.md
│ │ ├── same_bullet.html
│ │ ├── same_bullet.md
│ │ ├── setext_blankline.html
│ │ ├── setext_blankline.md
│ │ ├── setext_no_blankline.html
│ │ ├── setext_no_blankline.md
│ │ ├── space_after_table.html
│ │ ├── space_after_table.md
│ │ ├── strikethrough_in_em_strong.html
│ │ ├── strikethrough_in_em_strong.md
│ │ ├── strong_following_nptables.html
│ │ ├── strong_following_nptables.md
│ │ ├── strong_following_tables.html
│ │ ├── strong_following_tables.md
│ │ ├── substitutions.html
│ │ ├── substitutions.md
│ │ ├── tab_after_blockquote.html
│ │ ├── tab_after_blockquote.md
│ │ ├── tab_newline.html
│ │ ├── tab_newline.md
│ │ ├── table_cells.html
│ │ ├── table_cells.md
│ │ ├── table_following_text.html
│ │ ├── table_following_text.md
│ │ ├── table_reference_link.html
│ │ ├── table_reference_link.md
│ │ ├── table_vs_setext.html
│ │ ├── table_vs_setext.md
│ │ ├── tabs_code.html
│ │ ├── tabs_code.md
│ │ ├── text_following_nptables.html
│ │ ├── text_following_nptables.md
│ │ ├── text_following_tables.html
│ │ ├── text_following_tables.md
│ │ ├── toplevel_paragraphs.html
│ │ ├── toplevel_paragraphs.md
│ │ ├── tricky_list.html
│ │ ├── tricky_list.md
│ │ ├── underscore_link.html
│ │ ├── underscore_link.md
│ │ ├── unicode_punctuation.html
│ │ ├── unicode_punctuation.md
│ │ ├── whiltespace_lines.html
│ │ └── whiltespace_lines.md
│ ├── original
│ │ ├── amps_and_angles_encoding.html
│ │ ├── amps_and_angles_encoding.md
│ │ ├── auto_links.html
│ │ ├── auto_links.md
│ │ ├── backslash_escapes.html
│ │ ├── backslash_escapes.md
│ │ ├── blockquotes_with_code_blocks.html
│ │ ├── blockquotes_with_code_blocks.md
│ │ ├── code_blocks.html
│ │ ├── code_blocks.md
│ │ ├── code_spans.html
│ │ ├── code_spans.md
│ │ ├── hard_wrapped_paragraphs_with_list_like_lines.html
│ │ ├── hard_wrapped_paragraphs_with_list_like_lines.md
│ │ ├── horizontal_rules.html
│ │ ├── horizontal_rules.md
│ │ ├── inline_html_advanced.html
│ │ ├── inline_html_advanced.md
│ │ ├── inline_html_comments.html
│ │ ├── inline_html_comments.md
│ │ ├── inline_html_simple.html
│ │ ├── inline_html_simple.md
│ │ ├── links_inline_style.html
│ │ ├── links_inline_style.md
│ │ ├── links_reference_style.html
│ │ ├── links_reference_style.md
│ │ ├── links_shortcut_references.html
│ │ ├── links_shortcut_references.md
│ │ ├── literal_quotes_in_titles.html
│ │ ├── literal_quotes_in_titles.md
│ │ ├── markdown_documentation_basics.html
│ │ ├── markdown_documentation_basics.md
│ │ ├── markdown_documentation_syntax.html
│ │ ├── markdown_documentation_syntax.md
│ │ ├── nested_blockquotes.html
│ │ ├── nested_blockquotes.md
│ │ ├── ordered_and_unordered_lists.html
│ │ ├── ordered_and_unordered_lists.md
│ │ ├── tabs.html
│ │ ├── tabs.md
│ │ ├── tidyness.html
│ │ └── tidyness.md
│ └── redos
│ │ ├── cubic_def.cjs
│ │ ├── link_code.html
│ │ ├── link_code.md
│ │ ├── link_redos.html
│ │ ├── link_redos.md
│ │ ├── quadratic_br.cjs
│ │ ├── quadratic_em_mask.cjs
│ │ ├── quadratic_email.cjs
│ │ ├── quadratic_heading.cjs
│ │ ├── quadratic_lists.cjs
│ │ ├── quadratic_underscores.cjs
│ │ ├── redos_html_closing.html
│ │ ├── redos_html_closing.md
│ │ ├── redos_nolink.html
│ │ ├── redos_nolink.md
│ │ ├── reflink_redos.html
│ │ └── reflink_redos.md
├── types
│ └── marked.ts
├── umd-test.js
├── unit
│ ├── Hooks.test.js
│ ├── Lexer.test.js
│ ├── Parser.test.js
│ ├── bin.test.js
│ ├── fixtures
│ │ └── bin-config.js
│ ├── instance.test.js
│ ├── marked.test.js
│ └── utils.js
└── update-specs.js
├── tsconfig-type-test.json
├── tsconfig.json
└── vercel.json
/.devcontainer/devcontainer.json:
--------------------------------------------------------------------------------
1 | // For format details, see https://aka.ms/devcontainer.json. For config options, see the
2 | // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
3 | {
4 | "name": "marked",
5 | // We're using node 14 for development, to keep close to the engine compatibility that marked.js uses.
6 | "image": "mcr.microsoft.com/devcontainers/javascript-node:0-14",
7 | "postCreateCommand": "npm install",
8 |
9 | // Configure tool-specific properties.
10 | "customizations": {
11 | // Configure properties specific to VS Code.
12 | "vscode": {
13 | "extensions": [
14 | "dbaeumeur.vscode-eslint"
15 | ]
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*.{json,js}]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 | indent_style = space
8 | indent_size = 2
9 |
10 | [*.md, !test/*.md]
11 | charset = utf-8
12 | end_of_line = lf
13 | insert_final_newline = true
14 | trim_trailing_whitespace = true
15 | indent_style = tab
16 | indent_size = 4
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * eol=lf
2 | test/* linguist-vendored
3 | lib/* linguist-generated
4 | marked.min.js linguist-generated
5 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | **Marked version:**
2 |
3 | **Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a
4 |
5 |
6 |
7 |
18 |
19 | ## Expectation
20 |
21 | **CommonMark Demo:** [demo](https://spec.commonmark.org/dingus/)
22 |
23 |
24 |
25 |
26 | ## Result
27 |
28 | **Marked Demo:** [demo](https://marked.js.org/demo/)
29 |
30 |
31 |
32 |
33 | ## What was attempted
34 |
35 |
36 |
37 |
43 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Marked says it does this thing but does not
4 |
5 | ---
6 | **Marked version:**
7 |
8 | **Describe the bug**
9 | A clear and concise description of what the bug is.
10 |
11 | **To Reproduce**
12 | Steps to reproduce the behavior:
13 |
14 |
15 |
19 |
20 |
21 |
26 |
27 | **Expected behavior**
28 | A clear and concise description of what you expected to happen.
29 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Marked doesn't do this thing and I think it should
4 |
5 | ---
6 |
7 | **Describe the feature**
8 | A clear and concise description of what you would like.
9 |
10 | **Why is this feature necessary?**
11 | A clear and concise description of why.
12 |
13 | **Describe alternatives you've considered**
14 | A clear and concise description of any alternative solutions or features you've considered.
15 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/Proposal.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Proposal
3 | about: Marked doesn't do this thing and I think it should
4 |
5 | ---
6 |
7 | **What pain point are you perceiving?.**
8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9 |
10 | **Describe the solution you'd like**
11 | A clear and concise description of what you want to happen.
12 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 | **Marked version:**
12 |
13 |
14 |
15 | **Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a
16 |
17 | ## Description
18 |
19 | - Fixes #### (if fixing a known issue; otherwise, describe issue using the following format)
20 |
21 |
38 |
39 | ## Contributor
40 |
41 | - [ ] Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
42 | - [ ] no tests required for this PR.
43 | - [ ] If submitting new feature, it has been documented in the appropriate places.
44 |
45 | ## Committer
46 |
47 | In most cases, this should be a different person than the contributor.
48 |
49 | - [ ] CI is green (no forced merge required).
50 | - [ ] Squash and Merge PR following [conventional commit guidelines](https://www.conventionalcommits.org/).
51 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE/badges.md:
--------------------------------------------------------------------------------
1 | **@mention the contributor:**
2 |
3 | ## Recommendation to:
4 |
5 | - [ ] Change user group
6 | - [ ] Add a badge
7 | - [ ] Remove a badge
8 |
9 |
16 |
17 | ## As the one mentioned, I would like to:
18 |
19 | - [ ] accept the recommendation; or,
20 | - [ ] graciously decline; or,
21 | - [ ] dispute the recommendation
22 |
23 | within 30 days, if you have not indicated which option you are taking one of the following will happen:
24 |
25 | 1. If adding a badge, we will assume you are graciously declining.
26 | 2. If removing a badge, we will assume you do not want to dispute the recommendation; therefore, the badge will be removed.
27 |
28 |
49 |
50 | Note: All committers must approve via review before merging, the disapproving committer can simply close the PR.
51 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "github-actions"
4 | directory: "/"
5 | schedule:
6 | interval: "weekly"
7 | - package-ecosystem: "npm"
8 | versioning-strategy: "increase"
9 | directory: "/"
10 | schedule:
11 | interval: "weekly"
12 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: "Tests"
2 | on:
3 | pull_request:
4 | push:
5 | branches:
6 | - master
7 |
8 | permissions:
9 | contents: read
10 |
11 | jobs:
12 | UnitTests:
13 | strategy:
14 | matrix:
15 | # lowest verison here should also be in `engines` field
16 | node_version: [18, "lts/*", "latest"]
17 | runs-on: ubuntu-latest
18 | steps:
19 | - name: Checkout Code
20 | uses: actions/checkout@v4
21 | - name: Install Node
22 | uses: actions/setup-node@v4
23 | with:
24 | node-version: ${{ matrix.node_version }}
25 | check-latest: true
26 | - name: Install Dependencies
27 | run: npm ci
28 | - name: Build 🗜️
29 | run: npm run build
30 | - name: Run Unit Tests 👩🏽💻
31 | run: npm run test:unit
32 | - name: Run Spec Tests 👩🏽💻
33 | run: npm run test:specs
34 | - name: Run CJS Tests 👩🏽💻
35 | run: npm run test:cjs
36 |
37 | OtherTests:
38 | runs-on: ubuntu-latest
39 | steps:
40 | - name: Checkout Code
41 | uses: actions/checkout@v4
42 | - name: Install Node
43 | uses: actions/setup-node@v4
44 | with:
45 | node-version: "lts/*"
46 | - name: Install Dependencies
47 | run: npm ci
48 | - name: Build 🗜️
49 | run: npm run build
50 | - name: Run UMD Tests 👩🏽💻
51 | run: npm run test:umd
52 | - name: Run Types Tests 👩🏽💻
53 | run: npm run test:types
54 | - name: Lint ✨
55 | run: npm run test:lint
56 |
57 | Release:
58 | permissions:
59 | contents: write
60 | id-token: write
61 | needs: [UnitTests, OtherTests]
62 | if: |
63 | github.ref == 'refs/heads/master' &&
64 | github.event.repository.fork == false
65 | runs-on: ubuntu-latest
66 | steps:
67 | - name: Checkout Code
68 | uses: actions/checkout@v4
69 | - name: Install Node
70 | uses: actions/setup-node@v4
71 | with:
72 | node-version: "lts/*"
73 | - name: Install Dependencies
74 | run: npm ci
75 | - name: Build 🗜️
76 | env:
77 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
79 | run: |
80 | export SEMANTIC_RELEASE_NEXT_VERSION=$(npx semantic-release --no-ci --dry-run | grep -oP 'The next release version is \K[0-9]+\.[0-9]+\.[0-9]+')
81 | echo "Next Version: $SEMANTIC_RELEASE_NEXT_VERSION"
82 | npm run build
83 | if ! git diff --quiet; then
84 | git config --global user.email "<>"
85 | git config --global user.name "MarkedJS bot"
86 | git commit -am "🗜️ build v$SEMANTIC_RELEASE_NEXT_VERSION [skip ci]"
87 | fi
88 | - name: Release 🎉
89 | env:
90 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
92 | run: npx semantic-release
93 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .vercel
3 | .vscode
4 | node_modules/
5 | test/compiled_tests
6 | public
7 | lib
8 | docs/LICENSE.md
9 | vuln.js
10 | man/marked.1
11 | marked.min.js
12 | test.js
13 |
--------------------------------------------------------------------------------
/.releaserc.json:
--------------------------------------------------------------------------------
1 | {
2 | "plugins": [
3 | "@semantic-release/commit-analyzer",
4 | "@semantic-release/release-notes-generator",
5 | "@semantic-release/npm",
6 | "@semantic-release/github",
7 | "@semantic-release/git"
8 | ]
9 | }
10 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | see https://github.com/markedjs/marked/releases
2 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | # License information
2 |
3 | ## Contribution License Agreement
4 |
5 | If you contribute code to this project, you are implicitly allowing your code
6 | to be distributed under the MIT license. You are also implicitly verifying that
7 | all code is your original work. ``
8 |
9 | ## Marked
10 |
11 | Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
12 | Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
13 |
14 | Permission is hereby granted, free of charge, to any person obtaining a copy
15 | of this software and associated documentation files (the "Software"), to deal
16 | in the Software without restriction, including without limitation the rights
17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18 | copies of the Software, and to permit persons to whom the Software is
19 | furnished to do so, subject to the following conditions:
20 |
21 | The above copyright notice and this permission notice shall be included in
22 | all copies or substantial portions of the Software.
23 |
24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
30 | THE SOFTWARE.
31 |
32 | ## Markdown
33 |
34 | Copyright © 2004, John Gruber
35 | http://daringfireball.net/
36 | All rights reserved.
37 |
38 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
39 |
40 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
41 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
42 | * Neither the name “Markdown” nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
43 |
44 | This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
45 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | # Marked
6 |
7 | [](https://www.npmjs.com/package/marked)
8 | [](https://packagephobia.now.sh/result?p=marked)
9 | [](https://www.npmjs.com/package/marked)
10 | [](https://github.com/markedjs/marked/actions)
11 | [](https://snyk.io/test/npm/marked)
12 |
13 | - ⚡ built for speed
14 | - ⬇️ low-level compiler for parsing markdown without caching or blocking for long periods of time
15 | - ⚖️ light-weight while implementing all markdown features from the supported flavors & specifications
16 | - 🌐 works in a browser, on a server, or from a command line interface (CLI)
17 |
18 | ## Demo
19 |
20 | Checkout the [demo page](https://marked.js.org/demo/) to see marked in action ⛹️
21 |
22 | ## Docs
23 |
24 | Our [documentation pages](https://marked.js.org) are also rendered using marked 💯
25 |
26 | Also read about:
27 |
28 | * [Options](https://marked.js.org/using_advanced)
29 | * [Extensibility](https://marked.js.org/using_pro)
30 |
31 | ## Compatibility
32 |
33 | **Node.js:** Only [current and LTS](https://nodejs.org/en/about/releases/) Node.js versions are supported. End of life Node.js versions may become incompatible with Marked at any point in time.
34 |
35 | **Browser:** Not IE11 :)
36 |
37 | ## Installation
38 |
39 | **CLI:**
40 |
41 | ```sh
42 | npm install -g marked
43 | ```
44 |
45 | **In-browser:**
46 |
47 | ```sh
48 | npm install marked
49 | ```
50 |
51 | ## Usage
52 |
53 | ### Warning: 🚨 Marked does not [sanitize](https://marked.js.org/using_advanced#options) the output HTML. Please use a sanitize library, like [DOMPurify](https://github.com/cure53/DOMPurify) (recommended), [sanitize-html](https://github.com/apostrophecms/sanitize-html) or [insane](https://github.com/bevacqua/insane) on the *output* HTML! 🚨
54 |
55 | ```
56 | DOMPurify.sanitize(marked.parse(`
`));
57 | ```
58 |
59 | **CLI**
60 |
61 | ``` bash
62 | # Example with stdin input
63 | $ marked -o hello.html
64 | hello world
65 | ^D
66 | $ cat hello.html
67 |
hello world
68 | ``` 69 | 70 | ```bash 71 | # Print all options 72 | $ marked --help 73 | ``` 74 | 75 | **Browser** 76 | 77 | ```html 78 | 79 | 80 | 81 | 82 |