Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: markedjs/marked
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: cdaf80a489ae799c990c40bf97662e0607fb4479
Choose a base ref
...
head repository: markedjs/marked
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8a7502f54fcc236027ae38e5432c4caf30accf23
Choose a head ref
Loading
Showing with 8,187 additions and 1,844 deletions.
  1. +0 −3 .eslintrc.json
  2. +3 −3 .github/ISSUE_TEMPLATE.md
  3. +28 −27 .github/ISSUE_TEMPLATE/Bug_report.md
  4. +14 −14 .github/ISSUE_TEMPLATE/Feature_request.md
  5. +3 −3 .github/ISSUE_TEMPLATE/Proposal.md
  6. +1 −4 .github/PULL_REQUEST_TEMPLATE.md
  7. +3 −3 .github/PULL_REQUEST_TEMPLATE/badges.md
  8. +0 −25 .github/PULL_REQUEST_TEMPLATE/release.md
  9. +11 −0 .github/dependabot.yml
  10. +71 −0 .github/workflows/codeql-analysis.yml
  11. +9 −5 .github/workflows/tests.yml
  12. +3 −2 LICENSE.md
  13. +0 −2 README.md
  14. +0 −3 docs/.eslintrc.json
  15. +9 −1 docs/AUTHORS.md
  16. +6 −15 docs/PUBLISHING.md
  17. +2 −2 docs/USING_PRO.md
  18. +7 −2 docs/_document.html
  19. +4 −0 docs/demo/demo.css
  20. +46 −19 docs/demo/demo.js
  21. +5 −0 docs/demo/index.html
  22. +251 −183 lib/marked.esm.js
  23. +260 −179 lib/marked.js
  24. +2 −2 marked.min.js
  25. +6,875 −957 package-lock.json
  26. +27 −21 package.json
  27. +9 −0 release.config.js
  28. +1 −1 rollup.config.esm.js
  29. +2 −2 rollup.config.js
  30. +57 −29 src/Lexer.js
  31. +2 −0 src/Renderer.js
  32. +138 −86 src/Tokenizer.js
  33. +18 −1 src/helpers.js
  34. +32 −61 src/rules.js
  35. +0 −3 test/.eslintrc.json
  36. +6 −16 test/bench.js
  37. +1 −0 test/specs/bug/adjacent_lists.html
  38. +1 −0 test/specs/bug/adjacent_lists.md
  39. +33 −66 test/specs/commonmark/commonmark.0.29.json
  40. +33 −66 test/specs/gfm/commonmark.0.29.json
  41. +2 −1 test/specs/new/code_compensation_indent.html
  42. +4 −2 test/specs/new/code_consistent_newline.html
  43. +16 −0 test/specs/new/del_strikethrough.html
  44. +16 −0 test/specs/new/del_strikethrough.md
  45. +15 −0 test/specs/new/em_after_inline.html
  46. +16 −0 test/specs/new/em_after_inline.md
  47. +8 −9 test/specs/new/em_list_links.html
  48. +3 −1 test/specs/new/link_lt.html
  49. +5 −0 test/specs/new/link_lt.md
  50. +8 −0 test/specs/new/list_align_number.html
  51. +5 −0 test/specs/new/list_align_number.md
  52. +15 −0 test/specs/new/list_align_pedantic.html
  53. +10 −0 test/specs/new/list_align_pedantic.md
  54. +5 −0 test/specs/new/list_tasks_non_gfm.html
  55. +7 −0 test/specs/new/list_tasks_non_gfm.md
  56. +9 −0 test/specs/new/pedantic_heading.html
  57. +12 −0 test/specs/new/pedantic_heading.md
  58. +3 −0 test/specs/new/same_bullet.md
  59. +12 −0 test/specs/new/whiltespace_lines.html
  60. +18 −0 test/specs/new/whiltespace_lines.md
  61. +0 −7 test/specs/original/strong_and_em_together.html
  62. +0 −7 test/specs/original/strong_and_em_together.md
  63. +7 −0 test/specs/redos/quadratic_heading.js
  64. +4 −0 test/specs/redos/quadratic_underscores.js
  65. +2 −5 test/unit/Lexer-spec.js
  66. +12 −6 test/unit/marked-spec.js
3 changes: 0 additions & 3 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "standard",
"plugins": [
"standard"
],
"rules": {
"semi": ["error", "always"],
"indent": ["error", 2, {
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@

**Markdown flavor:** Markdown.pl|CommonMark|GitHub Flavored Markdown|n/a

<!-- The NPM version or commit hash having the issue -->
<!-- The NPM version or commit hash having the issue -->

<!--
<!--
If submitting something other than a defect with Marked itself, please use the following:
@@ -34,7 +34,7 @@

<!-- Describe what code combination got you there -->

<!--
<!--
If error is thrown add the following:
## Call stack & console log
55 changes: 28 additions & 27 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
---
name: Bug report
about: Marked says it does this thing but does not

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

<!-- If possible, use the Marked Demo permalink and compare to the CommonMark Dingus permalink to demonstrate the bug -->
<!--
1. [Marked Demo](https://marked.js.org/demo/)
2. [CommonMark Demo](https://spec.commonmark.org/dingus/)
-->

<!-- If you need a specific version and options to reproduce the bug, use the following template -->
<!--
1. Install marked `npm install --save marked@0.3.19` with the version you are using
2. Run marked with input string and options such as `marked('hello *world*', {gfm: true})`
3. Actual output (or error) is...
-->

**Expected behavior**
A clear and concise description of what you expected to happen.
---
name: Bug report
about: Marked says it does this thing but does not

---
**Marked version:**

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

<!-- If possible, use the Marked Demo permalink and compare to the CommonMark Dingus permalink to demonstrate the bug -->
<!--
1. [Marked Demo](https://marked.js.org/demo/)
2. [CommonMark Demo](https://spec.commonmark.org/dingus/)
-->

<!-- If you need a specific version and options to reproduce the bug, use the following template -->
<!--
1. Install marked `npm install --save marked@0.3.19` with the version you are using
2. Run marked with input string and options such as `marked('hello *world*', {gfm: true})`
3. Actual output (or error) is...
-->

**Expected behavior**
A clear and concise description of what you expected to happen.
28 changes: 14 additions & 14 deletions .github/ISSUE_TEMPLATE/Feature_request.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Feature request
about: Marked doesn't do this thing and I think it should

---

**Describe the feature**
A clear and concise description of what you would like.

**Why is this feature necessary?**
A clear and concise description of why.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
---
name: Feature request
about: Marked doesn't do this thing and I think it should

---

**Describe the feature**
A clear and concise description of what you would like.

**Why is this feature necessary?**
A clear and concise description of why.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/Proposal.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
name: Proposal
about: Marked doesn't do this thing and I think it should

---

**What pain point are you perceiving?.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
5 changes: 1 addition & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

<!--
If release PR, add ?template=release.md to the PR url to use the release PR template.
If badging PR, add ?template=badges.md to the PR url to use the badges PR template.
Otherwise, you are stating this PR fixes an issue that has been submitted; or,
@@ -48,6 +46,5 @@ Describe what code combination got you there

In most cases, this should be a different person than the contributor.

- [ ] Draft GitHub release notes have been updated.
- [ ] CI is green (no forced merge required).
- [ ] Merge PR
- [ ] Squash and Merge PR following [conventional commit guidelines](https://www.conventionalcommits.org/).
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/badges.md
Original file line number Diff line number Diff line change
@@ -6,9 +6,9 @@
- [ ] Add a badge
- [ ] Remove a badge

<!--
<!--
Explain your reasoning behind tagging that person.
Explain your reasoning behind tagging that person.
Preferably by citing objective examples, like PRs, Issues, and so on.
@@ -47,4 +47,4 @@ within 30 days, if you have not indicated which option you are taking one of the
-->

Note: All committers must approve via review before merging, the disapproving committer can simply close the PR.
Note: All committers must approve via review before merging, the disapproving committer can simply close the PR.
25 changes: 0 additions & 25 deletions .github/PULL_REQUEST_TEMPLATE/release.md

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
versioning-strategy: "increase"
directory: "/"
schedule:
interval: "weekly"
71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
schedule:
- cron: '0 9 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection by changing the below list
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python']
language: ['javascript']
# Learn more...
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
14 changes: 9 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -37,26 +37,30 @@ jobs:
- name: Lint ✨
run: npm run test:lint

Build:
Release:
needs: [Test, Lint]
if: github.ref == 'refs/heads/master'
if: |
github.ref == 'refs/heads/master' &&
github.event.repository.fork == false
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Install Dependencies
run: npm ci
- name: Build 🗜️
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run build
if ! git diff --quiet; then
git config --global user.email "<>"
git config --global user.name "MarkedJS bot"
git commit -am "🗜️ build [skip ci]"
git push "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/markedjs/marked.git" HEAD:master
fi
- name: Release 🎉
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release

Skip:
if: contains(github.event.head_commit.message, '[skip ci]')
5 changes: 3 additions & 2 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ all code is your original work. `</legalese>`

## Marked

Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)

Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -30,8 +31,8 @@ THE SOFTWARE.

## Markdown

Copyright © 2004, John Gruber
http://daringfireball.net/
Copyright © 2004, John Gruber
http://daringfireball.net/
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,8 +8,6 @@
[![gzip size](https://badgen.net/badgesize/gzip/https://cdn.jsdelivr.net/npm/marked/marked.min.js)](https://cdn.jsdelivr.net/npm/marked/marked.min.js)
[![install size](https://badgen.net/packagephobia/install/marked)](https://packagephobia.now.sh/result?p=marked)
[![downloads](https://badgen.net/npm/dt/marked)](https://www.npmjs.com/package/marked)
[![dep](https://badgen.net/david/dep/markedjs/marked?label=deps)](https://david-dm.org/markedjs/marked)
[![dev dep](https://badgen.net/david/dev/markedjs/marked?label=devDeps)](https://david-dm.org/markedjs/marked?type=dev)
[![github actions](https://github.com/markedjs/marked/workflows/Tests/badge.svg)](https://github.com/markedjs/marked/actions)
[![snyk](https://snyk.io/test/npm/marked/badge.svg)](https://snyk.io/test/npm/marked)

3 changes: 0 additions & 3 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": "standard",
"plugins": [
"standard"
],
"parserOptions": {
"ecmaVersion": 5,
"sourceType": "script"
10 changes: 9 additions & 1 deletion docs/AUTHORS.md
Original file line number Diff line number Diff line change
@@ -53,12 +53,20 @@ Marked takes an encompassing approach to its community. As such, you can think o
<small>Release Wrangler; Titan of the test harness; Dr. DevOps</small>
</td>
<td align="center" valign="top">
&nbsp;
<a href="https://github.com/calculuschild">
<img width="100" height="100" src="https://github.com/calculuschild.png?s=150">
</a>
<br>
<a href="https://github.com/calculuschild">Trevor Buckner</a>
<div>Committer</div>
<small>Master of Marked</small>
</td>
</tr>
</tbody>
</table>

## Contributors

<table>
<tbody>
<tr>
Loading