From 26ad33c950981fbb9de35a1c89bda0ed1509941b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Jun 2021 14:50:42 -0500
Subject: [PATCH 001/208] chore(deps-dev): Bump eslint-plugin-import from
2.23.3 to 2.23.4 (#2079)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package-lock.json | 29 ++++++++++++++---------------
package.json | 2 +-
2 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 4d369583f2..74e17e8894 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3257,9 +3257,9 @@
}
},
"es-abstract": {
- "version": "1.18.0",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0.tgz",
- "integrity": "sha512-LJzK7MrQa8TS0ja2w3YNLzUgJCGPdPOV1yVvezjNnS89D+VR08+Szt2mz3YB2Dck/+w5tfIq/RoUAFqJJGM2yw==",
+ "version": "1.18.3",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz",
+ "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
@@ -3270,14 +3270,14 @@
"has-symbols": "^1.0.2",
"is-callable": "^1.2.3",
"is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.2",
- "is-string": "^1.0.5",
- "object-inspect": "^1.9.0",
+ "is-regex": "^1.1.3",
+ "is-string": "^1.0.6",
+ "object-inspect": "^1.10.3",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
"string.prototype.trimend": "^1.0.4",
"string.prototype.trimstart": "^1.0.4",
- "unbox-primitive": "^1.0.0"
+ "unbox-primitive": "^1.0.1"
},
"dependencies": {
"call-bind": {
@@ -3546,9 +3546,9 @@
}
},
"eslint-plugin-import": {
- "version": "2.23.3",
- "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.3.tgz",
- "integrity": "sha512-wDxdYbSB55F7T5CC7ucDjY641VvKmlRwT0Vxh7PkY1mI4rclVRFWYfsrjDgZvwYYDZ5ee0ZtfFKXowWjqvEoRQ==",
+ "version": "2.23.4",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.23.4.tgz",
+ "integrity": "sha512-6/wP8zZRsnQFiR3iaPFgh5ImVRM1WN5NUWfTIRqwOdeiGJlBcSk82o1FEVq8yXmy4lkIzTo7YhHCIxlU/2HyEQ==",
"dev": true,
"requires": {
"array-includes": "^3.1.3",
@@ -7252,15 +7252,14 @@
}
},
"object.values": {
- "version": "1.1.3",
- "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.3.tgz",
- "integrity": "sha512-nkF6PfDB9alkOUxpf1HNm/QlkeW3SReqL5WXeBLpEJJnlPSvRaDQpW3gQTksTN3fgJX4hL42RzKyOin6ff3tyw==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.4.tgz",
+ "integrity": "sha512-TnGo7j4XSnKQoK3MfvkzqKCi0nVe/D9I9IjwTNYdb/fxYHpjrluHVOgw0AF6jrRFGMPHdfuidR09tIDiIvnaSg==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"define-properties": "^1.1.3",
- "es-abstract": "^1.18.0-next.2",
- "has": "^1.0.3"
+ "es-abstract": "^1.18.2"
},
"dependencies": {
"call-bind": {
diff --git a/package.json b/package.json
index a1da697d24..2408601dcb 100644
--- a/package.json
+++ b/package.json
@@ -47,7 +47,7 @@
"commonmark": "0.29.3",
"eslint": "^7.27.0",
"eslint-config-standard": "^16.0.3",
- "eslint-plugin-import": "^2.23.3",
+ "eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"front-matter": "^4.0.2",
From da27ce338ad8ffb87228fd31d17f650143a937f3 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Jun 2021 14:53:25 -0500
Subject: [PATCH 002/208] chore(deps-dev): Bump rollup-plugin-license from
2.3.0 to 2.4.0 (#2083)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package-lock.json | 40 ++++++++++++++++++++++++++++------------
package.json | 2 +-
2 files changed, 29 insertions(+), 13 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 74e17e8894..5bd8a089b3 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7385,9 +7385,9 @@
"dev": true
},
"package-name-regex": {
- "version": "1.0.9",
- "resolved": "https://registry.npmjs.org/package-name-regex/-/package-name-regex-1.0.9.tgz",
- "integrity": "sha512-+U2oQCfEz2IlGqws8gmfKzdMDbSd6+RZp6UIFdKo+GAw3+o+kfnsgXkWtJ1JMoKhpP2kEvuYyTy1lXOEQEe0ZA==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/package-name-regex/-/package-name-regex-2.0.1.tgz",
+ "integrity": "sha512-U+K6/cuwHwr/8pUQrpNpKOIFSdS/EluTRSmtn92mug1UiPcff4t9AHs36e2xXJtpEtRfbg+JOj3Y/GLX+mzT6w==",
"dev": true
},
"parent-module": {
@@ -7997,20 +7997,36 @@
}
},
"rollup-plugin-license": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-2.3.0.tgz",
- "integrity": "sha512-oi8pL59fVTwXCkLUsZ8dVGVJjO7Hcc5UT0chJvKd0MktPgeYHSadkaicAYUemdYHHpjb0D3DyvedZAEPt+2r8w==",
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-2.4.0.tgz",
+ "integrity": "sha512-hZ+usKNrAthT9bHBpSPQHs9wSI2zISso96t/ypdOpkCftpydZ6Yf5pkPD50vw1aFH+TSV0N+v+/nqGYiTAsL4Q==",
"dev": true,
"requires": {
"commenting": "1.1.0",
- "glob": "7.1.6",
+ "glob": "7.1.7",
"lodash": "4.17.21",
"magic-string": "0.25.7",
"mkdirp": "1.0.4",
"moment": "2.29.1",
- "package-name-regex": "1.0.9",
+ "package-name-regex": "2.0.1",
"spdx-expression-validate": "2.0.0",
- "spdx-satisfies": "5.0.0"
+ "spdx-satisfies": "5.0.1"
+ },
+ "dependencies": {
+ "glob": {
+ "version": "7.1.7",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
+ "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ }
}
},
"run-parallel": {
@@ -8302,9 +8318,9 @@
"dev": true
},
"spdx-satisfies": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.0.tgz",
- "integrity": "sha512-/hGhwh20BeGmkA+P/lm06RvXD94JduwNxtx/oX3B5ClPt1/u/m5MCaDNo1tV3Y9laLkQr/NRde63b9lLMhlNfw==",
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/spdx-satisfies/-/spdx-satisfies-5.0.1.tgz",
+ "integrity": "sha512-Nwor6W6gzFp8XX4neaKQ7ChV4wmpSh2sSDemMFSzHxpTw460jxFYeOn+jq4ybnSSw/5sc3pjka9MQPouksQNpw==",
"dev": true,
"requires": {
"spdx-compare": "^1.0.0",
diff --git a/package.json b/package.json
index 2408601dcb..0575c78daf 100644
--- a/package.json
+++ b/package.json
@@ -56,7 +56,7 @@
"markdown-it": "12.0.6",
"node-fetch": "^2.6.1",
"rollup": "^2.50.5",
- "rollup-plugin-license": "^2.3.0",
+ "rollup-plugin-license": "^2.4.0",
"semantic-release": "^17.4.3",
"titleize": "^2.1.0",
"uglify-js": "^3.13.8",
From 450b51d8a38aa4d190f8c94405c0e19e64dd1190 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Jun 2021 14:54:19 -0500
Subject: [PATCH 003/208] chore(deps-dev): Bump @babel/preset-env from 7.14.2
to 7.14.4 (#2081)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
package-lock.json | 347 ++++++++++++++++++++++++++++++++++------------
package.json | 2 +-
2 files changed, 257 insertions(+), 92 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 5bd8a089b3..da8e308560 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -206,19 +206,39 @@
}
},
"@babel/helper-create-class-features-plugin": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.2.tgz",
- "integrity": "sha512-6YctwVsmlkchxfGUogvVrrhzyD3grFJyluj5JgDlQrwfMLJSt5tdAzFZfPf4H2Xoi5YLcQ6BxfJlaOBHuctyIw==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.4.tgz",
+ "integrity": "sha512-idr3pthFlDCpV+p/rMgGLGYIVtazeatrSOQk8YzO2pAepIjQhCN3myeihVg58ax2bbbGK9PUE1reFi7axOYIOw==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.12.13",
"@babel/helper-function-name": "^7.14.2",
"@babel/helper-member-expression-to-functions": "^7.13.12",
"@babel/helper-optimise-call-expression": "^7.12.13",
- "@babel/helper-replace-supers": "^7.13.12",
+ "@babel/helper-replace-supers": "^7.14.4",
"@babel/helper-split-export-declaration": "^7.12.13"
},
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.12.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
+ "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.12.13"
+ }
+ },
+ "@babel/generator": {
+ "version": "7.14.3",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz",
+ "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.14.2",
+ "jsesc": "^2.5.1",
+ "source-map": "^0.5.0"
+ }
+ },
"@babel/helper-function-name": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz",
@@ -230,16 +250,61 @@
"@babel/types": "^7.14.2"
}
},
+ "@babel/helper-replace-supers": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.4.tgz",
+ "integrity": "sha512-zZ7uHCWlxfEAAOVDYQpEf/uyi1dmeC7fX4nCf2iz9drnCwi1zvwXL3HwWWNXUQEJ1k23yVn3VbddiI9iJEXaTQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-member-expression-to-functions": "^7.13.12",
+ "@babel/helper-optimise-call-expression": "^7.12.13",
+ "@babel/traverse": "^7.14.2",
+ "@babel/types": "^7.14.4"
+ }
+ },
"@babel/helper-validator-identifier": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
"integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==",
"dev": true
},
- "@babel/types": {
+ "@babel/highlight": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
+ "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.14.0",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ }
+ },
+ "@babel/parser": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz",
+ "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==",
+ "dev": true
+ },
+ "@babel/traverse": {
"version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
- "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz",
+ "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.12.13",
+ "@babel/generator": "^7.14.2",
+ "@babel/helper-function-name": "^7.14.2",
+ "@babel/helper-split-export-declaration": "^7.12.13",
+ "@babel/parser": "^7.14.2",
+ "@babel/types": "^7.14.2",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ }
+ },
+ "@babel/types": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz",
+ "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
@@ -249,9 +314,9 @@
}
},
"@babel/helper-create-regexp-features-plugin": {
- "version": "7.12.17",
- "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.12.17.tgz",
- "integrity": "sha512-p2VGmBu9oefLZ2nQpgnEnG0ZlRPvL8gAGvPUMQwUdaE8k49rOMuZpOwdQoy5qJf6K8jL3bcAMhVUlHAjIgJHUg==",
+ "version": "7.14.3",
+ "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.14.3.tgz",
+ "integrity": "sha512-JIB2+XJrb7v3zceV2XzDhGIB902CmKGSpSl4q2C6agU9SNLG/2V1RtFRGPG1Ajh9STj3+q6zJMOC+N/pp2P9DA==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.12.13",
@@ -259,9 +324,9 @@
}
},
"@babel/helper-define-polyfill-provider": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.0.tgz",
- "integrity": "sha512-JT8tHuFjKBo8NnaUbblz7mIu1nnvUDiHVjXXkulZULyidvo/7P6TY7+YqpV37IfF+KUFxmlK04elKtGKXaiVgw==",
+ "version": "0.2.3",
+ "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.3.tgz",
+ "integrity": "sha512-RH3QDAfRMzj7+0Nqu5oqgO5q9mFtQEVvCRsi8qCEfzLR9p2BHfn5FzhSB2oj1fF7I2+DcTORkYaQ6aTR9Cofew==",
"dev": true,
"requires": {
"@babel/helper-compilation-targets": "^7.13.0",
@@ -369,9 +434,9 @@
}
},
"@babel/generator": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.2.tgz",
- "integrity": "sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ==",
+ "version": "7.14.3",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz",
+ "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==",
"dev": true,
"requires": {
"@babel/types": "^7.14.2",
@@ -408,9 +473,9 @@
}
},
"@babel/parser": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.2.tgz",
- "integrity": "sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz",
+ "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==",
"dev": true
},
"@babel/traverse": {
@@ -430,9 +495,9 @@
}
},
"@babel/types": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
- "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz",
+ "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
@@ -523,9 +588,9 @@
}
},
"@babel/generator": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.2.tgz",
- "integrity": "sha512-OnADYbKrffDVai5qcpkMxQ7caomHOoEwjkouqnN2QhydAjowFAZcsdecFIRUBdb+ZcruwYE4ythYmF1UBZU5xQ==",
+ "version": "7.14.3",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz",
+ "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==",
"dev": true,
"requires": {
"@babel/types": "^7.14.2",
@@ -571,9 +636,9 @@
}
},
"@babel/parser": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.2.tgz",
- "integrity": "sha512-IoVDIHpsgE/fu7eXBeRWt8zLbDrSvD7H1gpomOkPpBoEN8KCruCqSDdqo8dddwQQrui30KSvQBaMUOJiuFu6QQ==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz",
+ "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==",
"dev": true
},
"@babel/traverse": {
@@ -593,9 +658,9 @@
}
},
"@babel/types": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
- "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz",
+ "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
@@ -912,11 +977,12 @@
}
},
"@babel/plugin-proposal-class-static-block": {
- "version": "7.13.11",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.13.11.tgz",
- "integrity": "sha512-fJTdFI4bfnMjvxJyNuaf8i9mVcZ0UhetaGEUHaHV9KEnibLugJkZAtXikR8KcYj+NYmI4DZMS8yQAyg+hvfSqg==",
+ "version": "7.14.3",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.3.tgz",
+ "integrity": "sha512-HEjzp5q+lWSjAgJtSluFDrGGosmwTgKwCXdDQZvhKsRlwv3YdkUEqxNrrjesJd+B9E9zvr1PVPVBvhYZ9msjvQ==",
"dev": true,
"requires": {
+ "@babel/helper-create-class-features-plugin": "^7.14.3",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/plugin-syntax-class-static-block": "^7.12.13"
}
@@ -982,16 +1048,42 @@
}
},
"@babel/plugin-proposal-object-rest-spread": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.2.tgz",
- "integrity": "sha512-hBIQFxwZi8GIp934+nj5uV31mqclC1aYDhctDu5khTi9PCCUOczyy0b34W0oE9U/eJXiqQaKyVsmjeagOaSlbw==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.4.tgz",
+ "integrity": "sha512-AYosOWBlyyXEagrPRfLJ1enStufsr7D1+ddpj8OLi9k7B6+NdZ0t/9V7Fh+wJ4g2Jol8z2JkgczYqtWrZd4vbA==",
"dev": true,
"requires": {
- "@babel/compat-data": "^7.14.0",
- "@babel/helper-compilation-targets": "^7.13.16",
+ "@babel/compat-data": "^7.14.4",
+ "@babel/helper-compilation-targets": "^7.14.4",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/plugin-syntax-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-parameters": "^7.14.2"
+ },
+ "dependencies": {
+ "@babel/compat-data": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.4.tgz",
+ "integrity": "sha512-i2wXrWQNkH6JplJQGn3Rd2I4Pij8GdHkXwHMxm+zV5YG/Jci+bCNrWZEWC4o+umiDkRrRs4dVzH3X4GP7vyjQQ==",
+ "dev": true
+ },
+ "@babel/helper-compilation-targets": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.4.tgz",
+ "integrity": "sha512-JgdzOYZ/qGaKTVkn5qEDV/SXAh8KcyUVkCoSWGN8T3bwrgd6m+/dJa2kVGi6RJYJgEYPBdZ84BZp9dUjNWkBaA==",
+ "dev": true,
+ "requires": {
+ "@babel/compat-data": "^7.14.4",
+ "@babel/helper-validator-option": "^7.12.17",
+ "browserslist": "^4.16.6",
+ "semver": "^6.3.0"
+ }
+ },
+ "semver": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
+ "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
+ "dev": true
+ }
}
},
"@babel/plugin-proposal-optional-catch-binding": {
@@ -1203,29 +1295,49 @@
}
},
"@babel/plugin-transform-block-scoping": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.2.tgz",
- "integrity": "sha512-neZZcP19NugZZqNwMTH+KoBjx5WyvESPSIOQb4JHpfd+zPfqcH65RMu5xJju5+6q/Y2VzYrleQTr+b6METyyxg==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.4.tgz",
+ "integrity": "sha512-5KdpkGxsZlTk+fPleDtGKsA+pon28+ptYmMO8GBSa5fHERCJWAzj50uAfCKBqq42HO+Zot6JF1x37CRprwmN4g==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.13.0"
}
},
"@babel/plugin-transform-classes": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.2.tgz",
- "integrity": "sha512-7oafAVcucHquA/VZCsXv/gmuiHeYd64UJyyTYU+MPfNu0KeNlxw06IeENBO8bJjXVbolu+j1MM5aKQtH1OMCNg==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.4.tgz",
+ "integrity": "sha512-p73t31SIj6y94RDVX57rafVjttNr8MvKEgs5YFatNB/xC68zM3pyosuOEcQmYsYlyQaGY9R7rAULVRcat5FKJQ==",
"dev": true,
"requires": {
"@babel/helper-annotate-as-pure": "^7.12.13",
"@babel/helper-function-name": "^7.14.2",
"@babel/helper-optimise-call-expression": "^7.12.13",
"@babel/helper-plugin-utils": "^7.13.0",
- "@babel/helper-replace-supers": "^7.13.12",
+ "@babel/helper-replace-supers": "^7.14.4",
"@babel/helper-split-export-declaration": "^7.12.13",
"globals": "^11.1.0"
},
"dependencies": {
+ "@babel/code-frame": {
+ "version": "7.12.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
+ "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.12.13"
+ }
+ },
+ "@babel/generator": {
+ "version": "7.14.3",
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.3.tgz",
+ "integrity": "sha512-bn0S6flG/j0xtQdz3hsjJ624h3W0r3llttBMfyHX3YrZ/KtLYr15bjA0FXkgW7FpvrDuTuElXeVjiKlYRpnOFA==",
+ "dev": true,
+ "requires": {
+ "@babel/types": "^7.14.2",
+ "jsesc": "^2.5.1",
+ "source-map": "^0.5.0"
+ }
+ },
"@babel/helper-function-name": {
"version": "7.14.2",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.2.tgz",
@@ -1237,16 +1349,61 @@
"@babel/types": "^7.14.2"
}
},
+ "@babel/helper-replace-supers": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.4.tgz",
+ "integrity": "sha512-zZ7uHCWlxfEAAOVDYQpEf/uyi1dmeC7fX4nCf2iz9drnCwi1zvwXL3HwWWNXUQEJ1k23yVn3VbddiI9iJEXaTQ==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-member-expression-to-functions": "^7.13.12",
+ "@babel/helper-optimise-call-expression": "^7.12.13",
+ "@babel/traverse": "^7.14.2",
+ "@babel/types": "^7.14.4"
+ }
+ },
"@babel/helper-validator-identifier": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
"integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==",
"dev": true
},
- "@babel/types": {
+ "@babel/highlight": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
+ "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.14.0",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ }
+ },
+ "@babel/parser": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.4.tgz",
+ "integrity": "sha512-ArliyUsWDUqEGfWcmzpGUzNfLxTdTp6WU4IuP6QFSp9gGfWS6boxFCkJSJ/L4+RG8z/FnIU3WxCk6hPL9SSWeA==",
+ "dev": true
+ },
+ "@babel/traverse": {
"version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
- "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.2.tgz",
+ "integrity": "sha512-TsdRgvBFHMyHOOzcP9S6QU0QQtjxlRpEYOy3mcCO5RgmC305ki42aSAmfZEMSSYBla2oZ9BMqYlncBaKmD/7iA==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.12.13",
+ "@babel/generator": "^7.14.2",
+ "@babel/helper-function-name": "^7.14.2",
+ "@babel/helper-split-export-declaration": "^7.12.13",
+ "@babel/parser": "^7.14.2",
+ "@babel/types": "^7.14.2",
+ "debug": "^4.1.0",
+ "globals": "^11.1.0"
+ }
+ },
+ "@babel/types": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz",
+ "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
@@ -1265,9 +1422,9 @@
}
},
"@babel/plugin-transform-destructuring": {
- "version": "7.13.17",
- "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.13.17.tgz",
- "integrity": "sha512-UAUqiLv+uRLO+xuBKKMEpC+t7YRNVRqBsWWq1yKXbBZBje/t3IXCiSinZhjn/DC3qzBfICeYd2EFGEbHsh5RLA==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.14.4.tgz",
+ "integrity": "sha512-JyywKreTCGTUsL1OKu1A3ms/R1sTP0WxbpXlALeGzF53eB3bxtNkYdMj9SDgK7g6ImPy76J5oYYKoTtQImlhQA==",
"dev": true,
"requires": {
"@babel/helper-plugin-utils": "^7.13.0"
@@ -1523,26 +1680,26 @@
}
},
"@babel/preset-env": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.2.tgz",
- "integrity": "sha512-7dD7lVT8GMrE73v4lvDEb85cgcQhdES91BSD7jS/xjC6QY8PnRhux35ac+GCpbiRhp8crexBvZZqnaL6VrY8TQ==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.4.tgz",
+ "integrity": "sha512-GwMMsuAnDtULyOtuxHhzzuSRxFeP0aR/LNzrHRzP8y6AgDNgqnrfCCBm/1cRdTU75tRs28Eh76poHLcg9VF0LA==",
"dev": true,
"requires": {
- "@babel/compat-data": "^7.14.0",
- "@babel/helper-compilation-targets": "^7.13.16",
+ "@babel/compat-data": "^7.14.4",
+ "@babel/helper-compilation-targets": "^7.14.4",
"@babel/helper-plugin-utils": "^7.13.0",
"@babel/helper-validator-option": "^7.12.17",
"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.13.12",
"@babel/plugin-proposal-async-generator-functions": "^7.14.2",
"@babel/plugin-proposal-class-properties": "^7.13.0",
- "@babel/plugin-proposal-class-static-block": "^7.13.11",
+ "@babel/plugin-proposal-class-static-block": "^7.14.3",
"@babel/plugin-proposal-dynamic-import": "^7.14.2",
"@babel/plugin-proposal-export-namespace-from": "^7.14.2",
"@babel/plugin-proposal-json-strings": "^7.14.2",
"@babel/plugin-proposal-logical-assignment-operators": "^7.14.2",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2",
"@babel/plugin-proposal-numeric-separator": "^7.14.2",
- "@babel/plugin-proposal-object-rest-spread": "^7.14.2",
+ "@babel/plugin-proposal-object-rest-spread": "^7.14.4",
"@babel/plugin-proposal-optional-catch-binding": "^7.14.2",
"@babel/plugin-proposal-optional-chaining": "^7.14.2",
"@babel/plugin-proposal-private-methods": "^7.13.0",
@@ -1565,10 +1722,10 @@
"@babel/plugin-transform-arrow-functions": "^7.13.0",
"@babel/plugin-transform-async-to-generator": "^7.13.0",
"@babel/plugin-transform-block-scoped-functions": "^7.12.13",
- "@babel/plugin-transform-block-scoping": "^7.14.2",
- "@babel/plugin-transform-classes": "^7.14.2",
+ "@babel/plugin-transform-block-scoping": "^7.14.4",
+ "@babel/plugin-transform-classes": "^7.14.4",
"@babel/plugin-transform-computed-properties": "^7.13.0",
- "@babel/plugin-transform-destructuring": "^7.13.17",
+ "@babel/plugin-transform-destructuring": "^7.14.4",
"@babel/plugin-transform-dotall-regex": "^7.12.13",
"@babel/plugin-transform-duplicate-keys": "^7.12.13",
"@babel/plugin-transform-exponentiation-operator": "^7.12.13",
@@ -1595,7 +1752,7 @@
"@babel/plugin-transform-unicode-escapes": "^7.12.13",
"@babel/plugin-transform-unicode-regex": "^7.12.13",
"@babel/preset-modules": "^0.1.4",
- "@babel/types": "^7.14.2",
+ "@babel/types": "^7.14.4",
"babel-plugin-polyfill-corejs2": "^0.2.0",
"babel-plugin-polyfill-corejs3": "^0.2.0",
"babel-plugin-polyfill-regenerator": "^0.2.0",
@@ -1603,6 +1760,24 @@
"semver": "^6.3.0"
},
"dependencies": {
+ "@babel/compat-data": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.4.tgz",
+ "integrity": "sha512-i2wXrWQNkH6JplJQGn3Rd2I4Pij8GdHkXwHMxm+zV5YG/Jci+bCNrWZEWC4o+umiDkRrRs4dVzH3X4GP7vyjQQ==",
+ "dev": true
+ },
+ "@babel/helper-compilation-targets": {
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.4.tgz",
+ "integrity": "sha512-JgdzOYZ/qGaKTVkn5qEDV/SXAh8KcyUVkCoSWGN8T3bwrgd6m+/dJa2kVGi6RJYJgEYPBdZ84BZp9dUjNWkBaA==",
+ "dev": true,
+ "requires": {
+ "@babel/compat-data": "^7.14.4",
+ "@babel/helper-validator-option": "^7.12.17",
+ "browserslist": "^4.16.6",
+ "semver": "^6.3.0"
+ }
+ },
"@babel/helper-validator-identifier": {
"version": "7.14.0",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
@@ -1610,9 +1785,9 @@
"dev": true
},
"@babel/types": {
- "version": "7.14.2",
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.2.tgz",
- "integrity": "sha512-SdjAG/3DikRHpUOjxZgnkbR11xUlyDMUFJdvnIgZEE16mqmY0BINMmc4//JMJglEmn6i7sq6p+mGrFWyZ98EEw==",
+ "version": "7.14.4",
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.4.tgz",
+ "integrity": "sha512-lCj4aIs0xUefJFQnwwQv2Bxg7Omd6bgquZ6LGC+gGMh6/s5qDVfjuCMlDmYQ15SLsWHd9n+X3E75lKIhl5Lkiw==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.14.0",
@@ -2542,13 +2717,13 @@
}
},
"babel-plugin-polyfill-corejs2": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.0.tgz",
- "integrity": "sha512-9bNwiR0dS881c5SHnzCmmGlMkJLl0OUZvxrxHo9w/iNoRuqaPjqlvBf4HrovXtQs/au5yKkpcdgfT1cC5PAZwg==",
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.2.tgz",
+ "integrity": "sha512-kISrENsJ0z5dNPq5eRvcctITNHYXWOA4DUZRFYCz3jYCcvTb/A546LIddmoGNMVYg2U38OyFeNosQwI9ENTqIQ==",
"dev": true,
"requires": {
"@babel/compat-data": "^7.13.11",
- "@babel/helper-define-polyfill-provider": "^0.2.0",
+ "@babel/helper-define-polyfill-provider": "^0.2.2",
"semver": "^6.1.1"
},
"dependencies": {
@@ -2561,22 +2736,22 @@
}
},
"babel-plugin-polyfill-corejs3": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.0.tgz",
- "integrity": "sha512-zZyi7p3BCUyzNxLx8KV61zTINkkV65zVkDAFNZmrTCRVhjo1jAS+YLvDJ9Jgd/w2tsAviCwFHReYfxO3Iql8Yg==",
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.2.tgz",
+ "integrity": "sha512-l1Cf8PKk12eEk5QP/NQ6TH8A1pee6wWDJ96WjxrMXFLHLOBFzYM4moG80HFgduVhTqAFez4alnZKEhP/bYHg0A==",
"dev": true,
"requires": {
- "@babel/helper-define-polyfill-provider": "^0.2.0",
+ "@babel/helper-define-polyfill-provider": "^0.2.2",
"core-js-compat": "^3.9.1"
}
},
"babel-plugin-polyfill-regenerator": {
- "version": "0.2.0",
- "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.0.tgz",
- "integrity": "sha512-J7vKbCuD2Xi/eEHxquHN14bXAW9CXtecwuLrOIDJtcZzTaPzV1VdEfoUf9AzcRBMolKUQKM9/GVojeh0hFiqMg==",
+ "version": "0.2.2",
+ "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.2.tgz",
+ "integrity": "sha512-Goy5ghsc21HgPDFtzRkSirpZVW35meGoTmTOb2bxqdl60ghub4xOidgNTHaZfQ2FaxQsKmwvXtOAkcIS4SMBWg==",
"dev": true,
"requires": {
- "@babel/helper-define-polyfill-provider": "^0.2.0"
+ "@babel/helper-define-polyfill-provider": "^0.2.2"
}
},
"balanced-match": {
@@ -2947,25 +3122,15 @@
}
},
"core-js-compat": {
- "version": "3.12.1",
- "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.12.1.tgz",
- "integrity": "sha512-i6h5qODpw6EsHAoIdQhKoZdWn+dGBF3dSS8m5tif36RlWvW3A6+yu2S16QHUo3CrkzrnEskMAt9f8FxmY9fhWQ==",
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.13.1.tgz",
+ "integrity": "sha512-mdrcxc0WznfRd8ZicEZh1qVeJ2mu6bwQFh8YVUK48friy/FOwFV5EJj9/dlh+nMQ74YusdVfBFDuomKgUspxWQ==",
"dev": true,
"requires": {
"browserslist": "^4.16.6",
"semver": "7.0.0"
},
"dependencies": {
- "caniuse-lite": {
- "version": "1.0.30001228",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz",
- "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A=="
- },
- "electron-to-chromium": {
- "version": "1.3.728",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.728.tgz",
- "integrity": "sha512-SHv4ziXruBpb1Nz4aTuqEHBYi/9GNCJMYIJgDEXrp/2V01nFXMNFUTli5Z85f5ivSkioLilQatqBYFB44wNJrA=="
- },
"semver": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz",
diff --git a/package.json b/package.json
index 0575c78daf..2e9553fb51 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
],
"devDependencies": {
"@babel/core": "^7.14.2",
- "@babel/preset-env": "^7.14.2",
+ "@babel/preset-env": "^7.14.4",
"@markedjs/html-differ": "^3.0.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.0",
From 7cd03d7332847909de6b9c864ef7c10769b1a40b Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Tue, 1 Jun 2021 23:43:01 -0500
Subject: [PATCH 004/208] chore(deps-dev): Bump eslint-plugin-promise from
4.3.1 to 5.1.0 (#2084)
Bumps [eslint-plugin-promise](https://github.com/xjamundx/eslint-plugin-promise) from 4.3.1 to 5.1.0.
- [Release notes](https://github.com/xjamundx/eslint-plugin-promise/releases)
- [Changelog](https://github.com/xjamundx/eslint-plugin-promise/blob/development/CHANGELOG.md)
- [Commits](https://github.com/xjamundx/eslint-plugin-promise/commits)
---
updated-dependencies:
- dependency-name: eslint-plugin-promise
dependency-type: direct:development
update-type: version-update:semver-major
...
Signed-off-by: dependabot[bot] A Description List:marked.use()
-`marked.use(options)` is the recommended way to extend marked. The options object can contain any [option](/using_advanced#options) available in marked.
+`marked.use(extension)` is the recommended way to extend Marked. The `extension` object can contain any [option](/using_advanced#options) available in Marked:
-The `renderer` and `tokenizer` options can be an object with functions that will be merged into the `renderer` and `tokenizer` respectively.
-The `renderer` and `tokenizer` functions can return false to fallback to the previous function.
+```js
+const marked = require('marked');
+
+marked.use({
+ pedantic: false,
+ gfm: true,
+ breaks: false,
+ sanitize: false,
+ smartLists: true,
+ smartypants: false,
+ xhtml: false
+});
+```
+
+You can also supply multiple `extension` objects at once.
+
+```
+marked.use(myExtension, extension2, extension3);
+
+\\ EQUIVALENT TO:
+
+marked.use(myExtension);
+marked.use(extension2);
+marked.use(extension3);
+
+```
-The `walkTokens` option can be a function that will be called with every token before rendering. When calling `use` multiple times with different `walkTokens` functions each function will be called in the **reverse** order in which they were assigned.
+All options will overwrite those previously set, except for the following options which will be merged with the existing framework and can be used to change or extend the functionality of Marked: `renderer`, `tokenizer`, `walkTokens`, and `extensions`.
+
+* The `renderer` and `tokenizer` options are objects with functions that will be merged into the built-in `renderer` and `tokenizer` respectively.
+
+* The `walkTokens` option is a function that will be called to post-process every token before rendering.
+
+* The `extensions` option is an array of objects that can contain additional custom `renderer` and `tokenizer` steps that will execute before any of the default parsing logic occurs.
+
+***
+
+The Marked Pipeline
+
+Before building your custom extensions, it is important to understand the components that Marked uses to translate from Markdown to HTML:
+
+1) The user supplies Marked with an input string to be translated.
+2) The `lexer` feeds segments of the input text string into each `tokenizer`, and from their output, generates a series of tokens in a nested tree structure.
+3) Each `tokenizer` receives a segment of Markdown text and, if it matches a particular pattern, generates a token object containing any relevant information.
+4) The `walkTokens` function will traverse every token in the tree and perform any final adjustments to the token contents.
+4) The `parser` traverses the token tree and feeds each token into the appropriate `renderer`, and concatenates their outputs into the final HTML result.
+5) Each `renderer` receives a token and manipulates its contents to generate a segment of HTML.
+
+Marked provides methods of directly overriding the `renderer` and `tokenizer` for any existing token type, as well as inserting additional custom `renderer` and `tokenizer` functions to handle entirely custom syntax.
+
+***
-All other options will overwrite previously set options.
+The Renderer :
-renderer
The renderer
+The renderer defines the HTML output of a given token. If you supply a `renderer` object to the Marked options, it will be merged with the built-in renderer and any functions inside will override the default handling of that token type.
-The renderer defines the output of the parser.
+Calling `marked.use()` to override the same function multiple times will give priority to the version that was assigned *last*. Overriding functions can return `false` to fall back to the previous override in the sequence, or resume default behavior if all overrides return `false`. Returning any other value (including nothing) will prevent fallback behavior.
-**Example:** Overriding default heading token by adding an embedded anchor tag like on GitHub.
+**Example:** Overriding output of the default `heading` token by adding an embedded anchor tag like on GitHub.
```js
// Create reference instance
@@ -56,20 +103,31 @@ console.log(marked('# heading+'));
```
-### Block level renderer methods
-
-- code(*string* code, *string* infostring, *boolean* escaped)
-- blockquote(*string* quote)
-- html(*string* html)
-- heading(*string* text, *number* level, *string* raw, *Slugger* slugger)
-- hr()
-- list(*string* body, *boolean* ordered, *number* start)
-- listitem(*string* text, *boolean* task, *boolean* checked)
-- checkbox(*boolean* checked)
-- paragraph(*string* text)
-- table(*string* header, *string* body)
-- tablerow(*string* content)
-- tablecell(*string* content, *object* flags)
+### Block-level renderer methods
+
+- **code**(*string* code, *string* infostring, *boolean* escaped)
+- **blockquote**(*string* quote)
+- **html**(*string* html)
+- **heading**(*string* text, *number* level, *string* raw, *Slugger* slugger)
+- **hr**()
+- **list**(*string* body, *boolean* ordered, *number* start)
+- **listitem**(*string* text, *boolean* task, *boolean* checked)
+- **checkbox**(*boolean* checked)
+- **paragraph**(*string* text)
+- **table**(*string* header, *string* body)
+- **tablerow**(*string* content)
+- **tablecell**(*string* content, *object* flags)
+
+### Inline-level renderer methods
+
+- **strong**(*string* text)
+- **em**(*string* text)
+- **codespan**(*string* code)
+- **br**()
+- **del**(*string* text)
+- **link**(*string* href, *string* title, *string* text)
+- **image**(*string* href, *string* title, *string* text)
+- **text**(*string* text)
`slugger` has the `slug` method to create a unique id from value:
@@ -103,20 +161,13 @@ slugger.slug('foo') // foo-4
}
```
-### Inline level renderer methods
+***
-- strong(*string* text)
-- em(*string* text)
-- codespan(*string* code)
-- br()
-- del(*string* text)
-- link(*string* href, *string* title, *string* text)
-- image(*string* href, *string* title, *string* text)
-- text(*string* text)
+The Tokenizer :
-tokenizer
The tokenizer
+The tokenizer defines how to turn markdown text into tokens. If you supply a `tokenizer` object to the Marked options, it will be merged with the built-in tokenizer and any functions inside will override the default handling of that token type.
-The tokenizer defines how to turn markdown text into tokens.
+Calling `marked.use()` to override the same function multiple times will give priority to the version that was assigned *last*. Overriding functions can return `false` to fall back to the previous override in the sequence, or resume default behavior if all overrides return `false`. Returning any other value (including nothing) will prevent fallback behavior.
**Example:** Overriding default `codespan` tokenizer to include LaTeX.
@@ -157,34 +208,34 @@ console.log(marked('$ latex code $\n\n` other code `'));
### Block level tokenizer methods
-- space(*string* src)
-- code(*string* src)
-- fences(*string* src)
-- heading(*string* src)
-- nptable(*string* src)
-- hr(*string* src)
-- blockquote(*string* src)
-- list(*string* src)
-- html(*string* src)
-- def(*string* src)
-- table(*string* src)
-- lheading(*string* src)
-- paragraph(*string* src)
-- text(*string* src)
+- **space**(*string* src)
+- **code**(*string* src)
+- **fences**(*string* src)
+- **heading**(*string* src)
+- **nptable**(*string* src)
+- **hr**(*string* src)
+- **blockquote**(*string* src)
+- **list**(*string* src)
+- **html**(*string* src)
+- **def**(*string* src)
+- **table**(*string* src)
+- **lheading**(*string* src)
+- **paragraph**(*string* src)
+- **text**(*string* src)
### Inline level tokenizer methods
-- escape(*string* src)
-- tag(*string* src, *bool* inLink, *bool* inRawBlock)
-- link(*string* src)
-- reflink(*string* src, *object* links)
-- emStrong(*string* src, *string* maskedSrc, *string* prevChar)
-- codespan(*string* src)
-- br(*string* src)
-- del(*string* src)
-- autolink(*string* src, *function* mangle)
-- url(*string* src, *function* mangle)
-- inlineText(*string* src, *bool* inRawBlock, *function* smartypants)
+- **escape**(*string* src)
+- **tag**(*string* src, *bool* inLink, *bool* inRawBlock)
+- **link**(*string* src)
+- **reflink**(*string* src, *object* links)
+- **emStrong**(*string* src, *string* maskedSrc, *string* prevChar)
+- **codespan**(*string* src)
+- **br**(*string* src)
+- **del**(*string* src)
+- **autolink**(*string* src, *function* mangle)
+- **url**(*string* src, *function* mangle)
+- **inlineText**(*string* src, *bool* inRawBlock, *function* smartypants)
`mangle` is a method that changes text to HTML character references:
@@ -202,10 +253,14 @@ smartypants('"this ... string"')
// "“this … string”"
```
-Walk Tokens
+***
+
+Walk Tokens :
The walkTokens function gets called with every token. Child tokens are called before moving on to sibling tokens. Each token is passed by reference so updates are persisted when passed to the parser. The return value of the function is ignored.
+`marked.use()` can be called multiple times with different `walkTokens` functions. Each function will be called in order, starting with the function that was assigned *last*.
+
**Example:** Overriding heading tokens to start at h2.
```js
@@ -231,17 +286,165 @@ console.log(marked('# heading 2\n\n## heading 3'));
walkTokens
heading 3
```
-The lexer
+***
-The lexer takes a markdown string and calls the tokenizer functions.
+Custom Extensions :
-extensions
The parser
+You may supply an `extensions` array to the `options` object. This array can contain any number of `extension` objects, using the following properties:
-The parser takes tokens as input and calls the renderer functions.
+
+
+
+
+
+
+**Example:** Add a custom syntax to generate `name
level
start(string src)
src.match().index
, or even a simple src.index()
. Marked will use this function to ensure that it does not skip over any text that should be part of the custom token.tokenizer(string src, array tokens)
tokens
parameter contains the array of tokens that have been generated by the lexer up to that point, and can be used to access the previous token, for instance.
+
+The return value should be an object with the following parameters:
+
+
+
+
+The returned token can also contain any other custom parameters of your choice that your custom `renderer` might need to access.
+
+The tokenizer function has access to the lexer in the `this` object, which can be used if any internal section of the string needs to be parsed further, such as in handling any inline syntax on the text within a block token. The key functions that may be useful include:
+
+ type
name
parameter of the extension.raw
tokens [optional]
walkTokens
function by default.
+
+
+this.blockTokens(string text)
this.inlineTokens(string text)
tokens
parameter.renderer(object token)
+
+
+this.parse(array tokens)
this.parseInline(array tokens)
childTokens [optional]
walkTokens
functions. For instance, if you want to use a second custom parameter to contain child tokens in addition to tokens
, it could be listed here. If childTokens
is provided, the tokens
array will not be walked by default unless it is also included in the childTokens
array.
+ ` description lists.
+
+``` js
+const descriptionlist = {
+ name: 'descriptionList',
+ level: 'block', // Is this a block-level or inline-level tokenizer?
+ start(src) { return src.match(/:[^:\n]/)?.index; }, // Hint to Marked.js to stop and check for a match
+ tokenizer(src, tokens) {
+ const rule = /^(?::[^:\n]+:[^:\n]*(?:\n|$))+/; // Regex for the complete token
+ const match = rule.exec(src);
+ if (match) {
+ return { // Token to generate
+ type: 'descriptionList', // Should match "name" above
+ raw: match[0], // Text to consume from the source
+ text: match[0].trim(), // Additional custom properties
+ tokens: this.inlineTokens(match[0].trim()) // inlineTokens to process **bold**, *italics*, etc.
+ };
+ }
+ },
+ renderer(token) {
+ return `
${this.parseInline(token.tokens)}\n
`; // parseInline to turn child tokens into HTML
+ }
+};
+
+const description = {
+ name: 'description',
+ level: 'inline', // Is this a block-level or inline-level tokenizer?
+ start(src) { return src.match(/:/)?.index; }, // Hint to Marked.js to stop and check for a match
+ tokenizer(src, tokens) {
+ const rule = /^:([^:\n]+):([^:\n]*)(?:\n|$)/; // Regex for the complete token
+ const match = rule.exec(src);
+ if (match) {
+ return { // Token to generate
+ type: 'description', // Should match "name" above
+ raw: match[0], // Text to consume from the source
+ dt: this.inlineTokens(match[1].trim()), // Additional custom properties
+ dd: this.inlineTokens(match[2].trim())
+ };
+ }
+ },
+ renderer(token) {
+ return `\n
+
+```
***
-Access to lexer and parser
+The Lexer
+
+The lexer takes a markdown string and calls the tokenizer functions.
+
+
+The Parser
+
+The parser takes tokens as input and calls the renderer functions.
+
+Access to Lexer and Parser
You also have direct access to the lexer and parser if you so desire.
diff --git a/lib/marked.esm.js b/lib/marked.esm.js
index 8d916b5c92..c707636dfe 100644
--- a/lib/marked.esm.js
+++ b/lib/marked.esm.js
@@ -11,10 +11,12 @@
var defaults$5 = {exports: {}};
-function getDefaults$1() {
+var defaults = createCommonjsModule(function (module) {
+function getDefaults() {
return {
baseUrl: null,
breaks: false,
+ extensions: null,
gfm: true,
headerIds: true,
headerPrefix: '',
@@ -60,7 +62,7 @@ const escapeReplacements = {
"'": '''
};
const getEscapeReplacement = (ch) => escapeReplacements[ch];
-function escape$3(html, encode) {
+function escape(html, encode) {
if (encode) {
if (escapeTest.test(html)) {
return html.replace(escapeReplace, getEscapeReplacement);
@@ -76,7 +78,7 @@ function escape$3(html, encode) {
const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
-function unescape$1(html) {
+function unescape(html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(unescapeTest, (_, n) => {
n = n.toLowerCase();
@@ -91,7 +93,7 @@ function unescape$1(html) {
}
const caret = /(^|[^\[])\^/g;
-function edit$1(regex, opt) {
+function edit(regex, opt) {
regex = regex.source || regex;
opt = opt || '';
const obj = {
@@ -110,11 +112,11 @@ function edit$1(regex, opt) {
const nonWordAndColonTest = /[^\w:]/g;
const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
-function cleanUrl$1(sanitize, base, href) {
+function cleanUrl(sanitize, base, href) {
if (sanitize) {
let prot;
try {
- prot = decodeURIComponent(unescape$1(href))
+ prot = decodeURIComponent(unescape(href))
.replace(nonWordAndColonTest, '')
.toLowerCase();
} catch (e) {
@@ -148,7 +150,7 @@ function resolveUrl(base, href) {
if (justDomain.test(base)) {
baseUrls[' ' + base] = base + '/';
} else {
- baseUrls[' ' + base] = rtrim$1(base, '/', true);
+ baseUrls[' ' + base] = rtrim(base, '/', true);
}
}
base = baseUrls[' ' + base];
@@ -169,9 +171,9 @@ function resolveUrl(base, href) {
}
}
-const noopTest$1 = { exec: function noopTest() {} };
+const noopTest = { exec: function noopTest() {} };
-function merge$2(obj) {
+function merge(obj) {
let i = 1,
target,
key;
@@ -188,7 +190,7 @@ function merge$2(obj) {
return obj;
}
-function splitCells$1(tableRow, count) {
+function splitCells(tableRow, count) {
// ensure that every cell-delimiting pipe has a space
// before it to distinguish it from an escaped pipe
const row = tableRow.replace(/\|/g, (match, offset, str) => {
@@ -223,7 +225,7 @@ function splitCells$1(tableRow, count) {
// Remove trailing 'c's. Equivalent to str.replace(/c*$/, '').
// /c*$/ is vulnerable to REDOS.
// invert: Remove suffix of non-c chars instead. Default falsey.
-function rtrim$1(str, c, invert) {
+function rtrim(str, c, invert) {
const l = str.length;
if (l === 0) {
return '';
@@ -247,7 +249,7 @@ function rtrim$1(str, c, invert) {
return str.substr(0, l - suffLen);
}
-function findClosingBracket$1(str, b) {
+function findClosingBracket(str, b) {
if (str.indexOf(b[1]) === -1) {
return -1;
}
@@ -269,14 +271,14 @@ function findClosingBracket$1(str, b) {
return -1;
}
-function checkSanitizeDeprecation$1(opt) {
+function checkSanitizeDeprecation(opt) {
if (opt && opt.sanitize && !opt.silent) {
console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
}
}
// copied from https://stackoverflow.com/a/5450113/806777
-function repeatString$1(pattern, count) {
+function repeatString(pattern, count) {
if (count < 1) {
return '';
}
@@ -292,31 +294,31 @@ function repeatString$1(pattern, count) {
}
var helpers = {
- escape: escape$3,
- unescape: unescape$1,
- edit: edit$1,
- cleanUrl: cleanUrl$1,
+ escape,
+ unescape,
+ edit,
+ cleanUrl,
resolveUrl,
- noopTest: noopTest$1,
- merge: merge$2,
- splitCells: splitCells$1,
- rtrim: rtrim$1,
- findClosingBracket: findClosingBracket$1,
- checkSanitizeDeprecation: checkSanitizeDeprecation$1,
- repeatString: repeatString$1
+ noopTest,
+ merge,
+ splitCells,
+ rtrim,
+ findClosingBracket,
+ checkSanitizeDeprecation,
+ repeatString
};
-const { defaults: defaults$4 } = defaults$5.exports;
+const { defaults: defaults$1 } = defaults;
const {
- rtrim,
- splitCells,
- escape: escape$2,
- findClosingBracket
+ rtrim: rtrim$1,
+ splitCells: splitCells$1,
+ escape: escape$1,
+ findClosingBracket: findClosingBracket$1
} = helpers;
function outputLink(cap, link, raw) {
const href = link.href;
- const title = link.title ? escape$2(link.title) : null;
+ const title = link.title ? escape$1(link.title) : null;
const text = cap[1].replace(/\\([\[\]])/g, '$1');
if (cap[0].charAt(0) !== '!') {
@@ -333,7 +335,7 @@ function outputLink(cap, link, raw) {
raw,
href,
title,
- text: escape$2(text)
+ text: escape$1(text)
};
}
}
@@ -371,7 +373,7 @@ function indentCodeCompensation(raw, text) {
*/
var Tokenizer_1 = class Tokenizer {
constructor(options) {
- this.options = options || defaults$4;
+ this.options = options || defaults$1;
}
space(src) {
@@ -396,7 +398,7 @@ var Tokenizer_1 = class Tokenizer {
raw: cap[0],
codeBlockStyle: 'indented',
text: !this.options.pedantic
- ? rtrim(text, '\n')
+ ? rtrim$1(text, '\n')
: text
};
}
@@ -424,7 +426,7 @@ var Tokenizer_1 = class Tokenizer {
// remove trailing #s
if (/#$/.test(text)) {
- const trimmed = rtrim(text, '#');
+ const trimmed = rtrim$1(text, '#');
if (this.options.pedantic) {
text = trimmed.trim();
} else if (!trimmed || / $/.test(trimmed)) {
@@ -447,7 +449,7 @@ var Tokenizer_1 = class Tokenizer {
if (cap) {
const item = {
type: 'table',
- header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
+ header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [],
raw: cap[0]
@@ -470,7 +472,7 @@ var Tokenizer_1 = class Tokenizer {
l = item.cells.length;
for (i = 0; i < l; i++) {
- item.cells[i] = splitCells(item.cells[i], item.header.length);
+ item.cells[i] = splitCells$1(item.cells[i], item.header.length);
}
return item;
@@ -592,7 +594,7 @@ var Tokenizer_1 = class Tokenizer {
}
// trim item newlines at end
- item = rtrim(item, '\n');
+ item = rtrim$1(item, '\n');
if (i !== l - 1) {
raw = raw + '\n';
}
@@ -644,7 +646,7 @@ var Tokenizer_1 = class Tokenizer {
raw: cap[0],
pre: !this.options.sanitizer
&& (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
- text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0])) : cap[0]
+ text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0]
};
}
}
@@ -669,7 +671,7 @@ var Tokenizer_1 = class Tokenizer {
if (cap) {
const item = {
type: 'table',
- header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')),
+ header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')),
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
};
@@ -693,7 +695,7 @@ var Tokenizer_1 = class Tokenizer {
l = item.cells.length;
for (i = 0; i < l; i++) {
- item.cells[i] = splitCells(
+ item.cells[i] = splitCells$1(
item.cells[i].replace(/^ *\| *| *\| *$/g, ''),
item.header.length);
}
@@ -745,7 +747,7 @@ var Tokenizer_1 = class Tokenizer {
return {
type: 'escape',
raw: cap[0],
- text: escape$2(cap[1])
+ text: escape$1(cap[1])
};
}
}
@@ -774,7 +776,7 @@ var Tokenizer_1 = class Tokenizer {
text: this.options.sanitize
? (this.options.sanitizer
? this.options.sanitizer(cap[0])
- : escape$2(cap[0]))
+ : escape$1(cap[0]))
: cap[0]
};
}
@@ -791,13 +793,13 @@ var Tokenizer_1 = class Tokenizer {
}
// ending angle bracket cannot be escaped
- const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\');
+ const rtrimSlash = rtrim$1(trimmedUrl.slice(0, -1), '\\');
if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) {
return;
}
} else {
// find closing parenthesis
- const lastParenIndex = findClosingBracket(cap[2], '()');
+ const lastParenIndex = findClosingBracket$1(cap[2], '()');
if (lastParenIndex > -1) {
const start = cap[0].indexOf('!') === 0 ? 5 : 4;
const linkLen = start + cap[1].length + lastParenIndex;
@@ -925,7 +927,7 @@ var Tokenizer_1 = class Tokenizer {
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
text = text.substring(1, text.length - 1);
}
- text = escape$2(text, true);
+ text = escape$1(text, true);
return {
type: 'codespan',
raw: cap[0],
@@ -960,10 +962,10 @@ var Tokenizer_1 = class Tokenizer {
if (cap) {
let text, href;
if (cap[2] === '@') {
- text = escape$2(this.options.mangle ? mangle(cap[1]) : cap[1]);
+ text = escape$1(this.options.mangle ? mangle(cap[1]) : cap[1]);
href = 'mailto:' + text;
} else {
- text = escape$2(cap[1]);
+ text = escape$1(cap[1]);
href = text;
}
@@ -988,7 +990,7 @@ var Tokenizer_1 = class Tokenizer {
if (cap = this.rules.inline.url.exec(src)) {
let text, href;
if (cap[2] === '@') {
- text = escape$2(this.options.mangle ? mangle(cap[0]) : cap[0]);
+ text = escape$1(this.options.mangle ? mangle(cap[0]) : cap[0]);
href = 'mailto:' + text;
} else {
// do extended autolink path validation
@@ -997,7 +999,7 @@ var Tokenizer_1 = class Tokenizer {
prevCapZero = cap[0];
cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
} while (prevCapZero !== cap[0]);
- text = escape$2(cap[0]);
+ text = escape$1(cap[0]);
if (cap[1] === 'www.') {
href = 'http://' + text;
} else {
@@ -1025,9 +1027,9 @@ var Tokenizer_1 = class Tokenizer {
if (cap) {
let text;
if (inRawBlock) {
- text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0])) : cap[0];
+ text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$1(cap[0])) : cap[0];
} else {
- text = escape$2(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
+ text = escape$1(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
}
return {
type: 'text',
@@ -1039,15 +1041,15 @@ var Tokenizer_1 = class Tokenizer {
};
const {
- noopTest,
- edit,
+ noopTest: noopTest$1,
+ edit: edit$1,
merge: merge$1
} = helpers;
/**
* Block-Level Grammar
*/
-const block$1 = {
+const block = {
newline: /^(?: *(?:\n|$))+/,
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,
@@ -1066,8 +1068,8 @@ const block$1 = {
+ '|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag
+ ')',
def: /^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,
- nptable: noopTest,
- table: noopTest,
+ nptable: noopTest$1,
+ table: noopTest$1,
lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,
// regex template, placeholders will be replaced according to different paragraph
// interruption rules of commonmark and the original markdown spec:
@@ -1075,68 +1077,68 @@ const block$1 = {
text: /^[^\n]+/
};
-block$1._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
-block$1._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
-block$1.def = edit(block$1.def)
- .replace('label', block$1._label)
- .replace('title', block$1._title)
+block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
+block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
+block.def = edit$1(block.def)
+ .replace('label', block._label)
+ .replace('title', block._title)
.getRegex();
-block$1.bullet = /(?:[*+-]|\d{1,9}[.)])/;
-block$1.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;
-block$1.item = edit(block$1.item, 'gm')
- .replace(/bull/g, block$1.bullet)
+block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
+block.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;
+block.item = edit$1(block.item, 'gm')
+ .replace(/bull/g, block.bullet)
.getRegex();
-block$1.listItemStart = edit(/^( *)(bull) */)
- .replace('bull', block$1.bullet)
+block.listItemStart = edit$1(/^( *)(bull) */)
+ .replace('bull', block.bullet)
.getRegex();
-block$1.list = edit(block$1.list)
- .replace(/bull/g, block$1.bullet)
+block.list = edit$1(block.list)
+ .replace(/bull/g, block.bullet)
.replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))')
- .replace('def', '\\n+(?=' + block$1.def.source + ')')
+ .replace('def', '\\n+(?=' + block.def.source + ')')
.getRegex();
-block$1._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
+block._tag = 'address|article|aside|base|basefont|blockquote|body|caption'
+ '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption'
+ '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe'
+ '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option'
+ '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr'
+ '|track|ul';
-block$1._comment = /|$)/;
-block$1.html = edit(block$1.html, 'i')
- .replace('comment', block$1._comment)
- .replace('tag', block$1._tag)
+block._comment = /|$)/;
+block.html = edit$1(block.html, 'i')
+ .replace('comment', block._comment)
+ .replace('tag', block._tag)
.replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/)
.getRegex();
-block$1.paragraph = edit(block$1._paragraph)
- .replace('hr', block$1.hr)
+block.paragraph = edit$1(block._paragraph)
+ .replace('hr', block.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('blockquote', ' {0,3}>')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
- .replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks
+ .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
.getRegex();
-block$1.blockquote = edit(block$1.blockquote)
- .replace('paragraph', block$1.paragraph)
+block.blockquote = edit$1(block.blockquote)
+ .replace('paragraph', block.paragraph)
.getRegex();
/**
* Normal Block Grammar
*/
-block$1.normal = merge$1({}, block$1);
+block.normal = merge$1({}, block);
/**
* GFM Block Grammar
*/
-block$1.gfm = merge$1({}, block$1.normal, {
+block.gfm = merge$1({}, block.normal, {
nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header
+ ' {0,3}([-:]+ *\\|[-| :]*)' // Align
+ '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', // Cells
@@ -1145,38 +1147,38 @@ block$1.gfm = merge$1({}, block$1.normal, {
+ '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
});
-block$1.gfm.nptable = edit(block$1.gfm.nptable)
- .replace('hr', block$1.hr)
+block.gfm.nptable = edit$1(block.gfm.nptable)
+ .replace('hr', block.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
- .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks
+ .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
.getRegex();
-block$1.gfm.table = edit(block$1.gfm.table)
- .replace('hr', block$1.hr)
+block.gfm.table = edit$1(block.gfm.table)
+ .replace('hr', block.hr)
.replace('heading', ' {0,3}#{1,6} ')
.replace('blockquote', ' {0,3}>')
.replace('code', ' {4}[^\\n]')
.replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n')
.replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
.replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)')
- .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks
+ .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
.getRegex();
/**
* Pedantic grammar (original John Gruber's loose markdown specification)
*/
-block$1.pedantic = merge$1({}, block$1.normal, {
- html: edit(
+block.pedantic = merge$1({}, block.normal, {
+ html: edit$1(
'^ *(?:comment *(?:\\n|\\s*$)'
+ '|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)' // closed tag
+ '|
\n';
}
return ''
- + (escaped ? code : escape$1(code, true))
+ + (escaped ? code : escape$2(code, true))
+ '
\n';
}
@@ -1974,11 +2032,11 @@ var Renderer_1 = class Renderer {
}
link(href, title, text) {
- href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
+ href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text;
}
- let out = 'An error occurred:'
- + (escaped ? code : escape$1(code, true))
+ + (escaped ? code : escape$2(code, true))
+ '
' - + escape(e.message + '', true) + + escape$3(e.message + '', true) + ''; } throw e; @@ -2494,59 +2562,113 @@ function marked(src, opt, callback) { marked.options = marked.setOptions = function(opt) { - merge(marked.defaults, opt); + merge$2(marked.defaults, opt); changeDefaults(marked.defaults); return marked; }; marked.getDefaults = getDefaults; -marked.defaults = defaults; +marked.defaults = defaults$5; /** * Use Extension */ marked.use = function(extension) { - const opts = merge({}, extension); - if (extension.renderer) { - const renderer = marked.defaults.renderer || new Renderer(); - for (const prop in extension.renderer) { - const prevRenderer = renderer[prop]; - renderer[prop] = (...args) => { - let ret = extension.renderer[prop].apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); - } - return ret; - }; - } - opts.renderer = renderer; + if (!Array.isArray(extension)) { // Wrap in array if not already to unify processing + extension = [extension]; } - if (extension.tokenizer) { - const tokenizer = marked.defaults.tokenizer || new Tokenizer(); - for (const prop in extension.tokenizer) { - const prevTokenizer = tokenizer[prop]; - tokenizer[prop] = (...args) => { - let ret = extension.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); + + const opts = merge$2({}, ...extension); + const extensions = marked.defaults.extensions || { renderers: {}, walkableTokens: {} }; + let hasExtensions; + + extension.forEach((pack) => { + // ==-- Parse "addon" extensions --== // + if (pack.extensions) { + hasExtensions = true; + pack.extensions.forEach((ext) => { + if (ext.renderer && ext.name) { // Renderers must have 'name' property + extensions.renderers[ext.name] = ext.renderer; } - return ret; - }; + if (ext.walkableTokens && ext.name) { // walkableTokens must have 'name' + extensions.walkableTokens[ext.name] = ext.walkableTokens; + } + if (ext.tokenizer && ext.level) { // Tokenizers must have 'level' property + if (extensions[ext.level]) { + extensions[ext.level].push(ext.tokenizer); + } else { + extensions[ext.level] = [ext.tokenizer]; + } + if (ext.start) { // Function to check for start of token + if (ext.level === 'block') { + if (extensions.startBlock) { + extensions.startBlock.push(ext.start); + } else { + extensions.startBlock = [ext.start]; + } + } else if (ext.level === 'inline') { + if (extensions.startInline) { + extensions.startInline.push(ext.start); + } else { + extensions.startInline = [ext.start]; + } + } + } + } + }); } - opts.tokenizer = tokenizer; - } - if (extension.walkTokens) { - const walkTokens = marked.defaults.walkTokens; - opts.walkTokens = (token) => { - extension.walkTokens(token); - if (walkTokens) { - walkTokens(token); + + // ==-- Parse "overwrite" extensions --== // + if (pack.renderer) { + const renderer = marked.defaults.renderer || new Renderer_1(); + for (const prop in pack.renderer) { + const prevRenderer = renderer[prop]; + // Replace renderer with func to run extension, but fall back if fail + renderer[prop] = (...args) => { + let ret = pack.renderer[prop].apply(renderer, args); + if (ret === false) { + ret = prevRenderer.apply(renderer, args); + } + return ret; + }; } - }; - } - marked.setOptions(opts); + opts.renderer = renderer; + } + if (pack.tokenizer) { + const tokenizer = marked.defaults.tokenizer || new Tokenizer_1(); + for (const prop in pack.tokenizer) { + const prevTokenizer = tokenizer[prop]; + // Replace tokenizer with func to run extension, but fall back if fail + tokenizer[prop] = (...args) => { + let ret = pack.tokenizer[prop].apply(tokenizer, args); + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args); + } + return ret; + }; + } + opts.tokenizer = tokenizer; + } + + // ==-- Parse WalkTokens extensions --== // + if (pack.walkTokens) { + const walkTokens = marked.defaults.walkTokens; + opts.walkTokens = (token) => { + pack.walkTokens(token); + if (walkTokens) { + walkTokens(token); + } + }; + } + + if (hasExtensions) { + opts.extensions = extensions; + } + + marked.setOptions(opts); + }); }; /** @@ -2573,7 +2695,12 @@ marked.walkTokens = function(tokens, callback) { break; } default: { - if (token.tokens) { + if (marked.defaults?.extensions?.walkableTokens?.[token.type]) { // Walk any extensions + marked.defaults?.extensions.walkableTokens[token.type].forEach(function(walkableTokens) { + marked.walkTokens(token[walkableTokens], callback); + }); + } + if (token.tokens && !marked.defaults?.extensions?.walkableTokens[token.type]?.tokens) { marked.walkTokens(token.tokens, callback); } } @@ -2594,8 +2721,8 @@ marked.parseInline = function(src, opt) { + Object.prototype.toString.call(src) + ', string expected'); } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); + opt = merge$2({}, marked.defaults, opt || {}); + checkSanitizeDeprecation$1(opt); try { const tokens = Lexer.lexInline(src, opt); @@ -2607,7 +2734,7 @@ marked.parseInline = function(src, opt) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if (opt.silent) { return '
An error occurred:
' - + escape(e.message + '', true) + + escape$3(e.message + '', true) + ''; } throw e; diff --git a/src/Lexer.js b/src/Lexer.js index 6c02ed65e5..03a06960f6 100644 --- a/src/Lexer.js +++ b/src/Lexer.js @@ -123,9 +123,21 @@ module.exports = class Lexer { if (this.options.pedantic) { src = src.replace(/^ +$/gm, ''); } - let token, i, l, lastToken; + let token, i, l, lastToken, cutSrc, lastParagraphClipped; while (src) { + if (this.options?.extensions?.block + && this.options.extensions.block.some((extTokenizer) => { + if (token = extTokenizer.call(this, src, tokens)) { + src = src.substring(token.raw.length); + tokens.push(token); + return true; + } + return false; + })) { + continue; + } + // newline if (token = this.tokenizer.space(src)) { src = src.substring(token.raw.length); @@ -230,9 +242,30 @@ module.exports = class Lexer { } // top-level paragraph - if (top && (token = this.tokenizer.paragraph(src))) { + // prevent paragraph consuming extensions by clipping 'src' to extension start + cutSrc = src; + if (this.options.extensions?.startBlock) { + let startIndex = Infinity; + const tempSrc = src.slice(1); + let tempStart; + this.options.extensions.startBlock.forEach(function(getStartIndex) { + tempStart = getStartIndex.call(this, tempSrc); + if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } + }); + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + } + if (top && (token = this.tokenizer.paragraph(cutSrc))) { + lastToken = tokens[tokens.length - 1]; + if (lastParagraphClipped && lastToken.type === 'paragraph') { + lastToken.raw += '\n' + token.raw; + lastToken.text += '\n' + token.text; + } else { + tokens.push(token); + } + lastParagraphClipped = (cutSrc.length !== src.length); src = src.substring(token.raw.length); - tokens.push(token); continue; } @@ -332,7 +365,7 @@ module.exports = class Lexer { * Lexing/Compiling */ inlineTokens(src, tokens = [], inLink = false, inRawBlock = false) { - let token, lastToken; + let token, lastToken, cutSrc; // String with links masked to avoid interference with em and strong let maskedSrc = src; @@ -366,6 +399,19 @@ module.exports = class Lexer { } keepPrevChar = false; + // extensions + if (this.options?.extensions?.inline + && this.options.extensions.inline.some((extTokenizer) => { + if (token = extTokenizer.call(this, src, tokens)) { + src = src.substring(token.raw.length); + tokens.push(token); + return true; + } + return false; + })) { + continue; + } + // escape if (token = this.tokenizer.escape(src)) { src = src.substring(token.raw.length); @@ -378,7 +424,7 @@ module.exports = class Lexer { src = src.substring(token.raw.length); inLink = token.inLink; inRawBlock = token.inRawBlock; - const lastToken = tokens[tokens.length - 1]; + lastToken = tokens[tokens.length - 1]; if (lastToken && token.type === 'text' && lastToken.type === 'text') { lastToken.raw += token.raw; lastToken.text += token.text; @@ -401,7 +447,7 @@ module.exports = class Lexer { // reflink, nolink if (token = this.tokenizer.reflink(src, this.tokens.links)) { src = src.substring(token.raw.length); - const lastToken = tokens[tokens.length - 1]; + lastToken = tokens[tokens.length - 1]; if (token.type === 'link') { token.tokens = this.inlineTokens(token.text, [], true, inRawBlock); tokens.push(token); @@ -459,7 +505,21 @@ module.exports = class Lexer { } // text - if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) { + // prevent inlineText consuming extensions by clipping 'src' to extension start + cutSrc = src; + if (this.options.extensions?.startInline) { + let startIndex = Infinity; + const tempSrc = src.slice(1); + let tempStart; + this.options.extensions.startInline.forEach(function(getStartIndex) { + tempStart = getStartIndex.call(this, tempSrc); + if (typeof tempStart === 'number' && tempStart >= 0) { startIndex = Math.min(startIndex, tempStart); } + }); + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + } + if (token = this.tokenizer.inlineText(cutSrc, inRawBlock, smartypants)) { src = src.substring(token.raw.length); if (token.raw.slice(-1) !== '_') { // Track prevChar before string of ____ started prevChar = token.raw.slice(-1); diff --git a/src/Parser.js b/src/Parser.js index 81fcb7da1e..f766269e0b 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -57,11 +57,22 @@ module.exports = class Parser { item, checked, task, - checkbox; + checkbox, + ret; const l = tokens.length; for (i = 0; i < l; i++) { token = tokens[i]; + + // Run any renderer extensions + if (this.options.extensions?.renderers?.[token.type]) { + ret = this.options.extensions.renderers[token.type].call(this, token); + if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { + out += ret || ''; + continue; + } + } + switch (token.type) { case 'space': { continue; @@ -179,6 +190,7 @@ module.exports = class Parser { out += top ? this.renderer.paragraph(body) : body; continue; } + default: { const errMsg = 'Token with "' + token.type + '" type was not found.'; if (this.options.silent) { @@ -201,11 +213,22 @@ module.exports = class Parser { renderer = renderer || this.renderer; let out = '', i, - token; + token, + ret; const l = tokens.length; for (i = 0; i < l; i++) { token = tokens[i]; + + // Run any renderer extensions + if (this.options.extensions?.renderers?.[token.type]) { + ret = this.options.extensions.renderers[token.type].call(this, token); + if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { + out += ret || ''; + continue; + } + } + switch (token.type) { case 'escape': { out += renderer.text(token.text); diff --git a/src/defaults.js b/src/defaults.js index fe376563da..a4b451fe2f 100644 --- a/src/defaults.js +++ b/src/defaults.js @@ -2,6 +2,7 @@ function getDefaults() { return { baseUrl: null, breaks: false, + extensions: null, gfm: true, headerIds: true, headerPrefix: '', diff --git a/src/marked.js b/src/marked.js index 0ba08156af..540eb20852 100644 --- a/src/marked.js +++ b/src/marked.js @@ -141,46 +141,114 @@ marked.defaults = defaults; * Use Extension */ -marked.use = function(extension) { - const opts = merge({}, extension); - if (extension.renderer) { - const renderer = marked.defaults.renderer || new Renderer(); - for (const prop in extension.renderer) { - const prevRenderer = renderer[prop]; - renderer[prop] = (...args) => { - let ret = extension.renderer[prop].apply(renderer, args); - if (ret === false) { - ret = prevRenderer.apply(renderer, args); +marked.use = function(...args) { + const opts = merge({}, ...args); + const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} }; + let hasExtensions; + + args.forEach((pack) => { + // ==-- Parse "addon" extensions --== // + if (pack.extensions) { + hasExtensions = true; + pack.extensions.forEach((ext) => { + if (!ext.name) { + throw new Error('extension name required'); } - return ret; - }; + if (ext.renderer) { // Renderer extensions + const prevRenderer = extensions.renderers?.[ext.name]; + if (prevRenderer) { + // Replace extension with func to run new extension but fall back if false + extensions.renderers[ext.name] = function(...args) { + let ret = ext.renderer.apply(this, args); + if (ret === false) { + ret = prevRenderer.apply(this, args); + } + return ret; + }; + } else { + extensions.renderers[ext.name] = ext.renderer; + } + } + if (ext.tokenizer) { // Tokenizer Extensions + if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) { + throw new Error("extension level must be 'block' or 'inline'"); + } + if (extensions[ext.level]) { + extensions[ext.level].unshift(ext.tokenizer); + } else { + extensions[ext.level] = [ext.tokenizer]; + } + if (ext.start) { // Function to check for start of token + if (ext.level === 'block') { + if (extensions.startBlock) { + extensions.startBlock.push(ext.start); + } else { + extensions.startBlock = [ext.start]; + } + } else if (ext.level === 'inline') { + if (extensions.startInline) { + extensions.startInline.push(ext.start); + } else { + extensions.startInline = [ext.start]; + } + } + } + } + if (ext.childTokens) { // Child tokens to be visited by walkTokens + extensions.childTokens[ext.name] = ext.childTokens; + } + }); } - opts.renderer = renderer; - } - if (extension.tokenizer) { - const tokenizer = marked.defaults.tokenizer || new Tokenizer(); - for (const prop in extension.tokenizer) { - const prevTokenizer = tokenizer[prop]; - tokenizer[prop] = (...args) => { - let ret = extension.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); + + // ==-- Parse "overwrite" extensions --== // + if (pack.renderer) { + const renderer = marked.defaults.renderer || new Renderer(); + for (const prop in pack.renderer) { + const prevRenderer = renderer[prop]; + // Replace renderer with func to run extension, but fall back if false + renderer[prop] = (...args) => { + let ret = pack.renderer[prop].apply(renderer, args); + if (ret === false) { + ret = prevRenderer.apply(renderer, args); + } + return ret; + }; + } + opts.renderer = renderer; + } + if (pack.tokenizer) { + const tokenizer = marked.defaults.tokenizer || new Tokenizer(); + for (const prop in pack.tokenizer) { + const prevTokenizer = tokenizer[prop]; + // Replace tokenizer with func to run extension, but fall back if false + tokenizer[prop] = (...args) => { + let ret = pack.tokenizer[prop].apply(tokenizer, args); + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args); + } + return ret; + }; + } + opts.tokenizer = tokenizer; + } + + // ==-- Parse WalkTokens extensions --== // + if (pack.walkTokens) { + const walkTokens = marked.defaults.walkTokens; + opts.walkTokens = (token) => { + pack.walkTokens.call(this, token); + if (walkTokens) { + walkTokens(token); } - return ret; }; } - opts.tokenizer = tokenizer; - } - if (extension.walkTokens) { - const walkTokens = marked.defaults.walkTokens; - opts.walkTokens = (token) => { - extension.walkTokens(token); - if (walkTokens) { - walkTokens(token); - } - }; - } - marked.setOptions(opts); + + if (hasExtensions) { + opts.extensions = extensions; + } + + marked.setOptions(opts); + }); }; /** @@ -207,7 +275,12 @@ marked.walkTokens = function(tokens, callback) { break; } default: { - if (token.tokens) { + if (marked.defaults?.extensions?.childTokens?.[token.type]) { // Walk any extensions + marked.defaults?.extensions.childTokens[token.type].forEach(function(childTokens) { + marked.walkTokens(token[childTokens], callback); + }); + } + if (token.tokens && !marked.defaults?.extensions?.childTokens[token.type]) { marked.walkTokens(token.tokens, callback); } } diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js index 86813cc29e..0845909222 100644 --- a/test/unit/marked-spec.js +++ b/test/unit/marked-spec.js @@ -137,6 +137,515 @@ describe('parseInline', () => { }); describe('use extension', () => { + it('should use custom block tokenizer + renderer extensions', () => { + const underline = { + name: 'underline', + level: 'block', + tokenizer(src) { + const rule = /^:([^\n]*)(?:\n|$)/; + const match = rule.exec(src); + if (match) { + return { + type: 'underline', + raw: match[0], // This is the text that you want your token to consume from the source + text: match[1].trim() // You can add additional properties to your tokens to pass along to the renderer + }; + } + }, + renderer(token) { + return `${token.text}\n`; + } + }; + marked.use({ extensions: [underline] }); + let html = marked('Not Underlined\n:Underlined\nNot Underlined'); + expect(html).toBe('
Not Underlined\n:Underlined\nNot Underlined
\n'); + + html = marked('Not Underlined\n\n:Underlined\n\nNot Underlined'); + expect(html).toBe('Not Underlined
\nUnderlined\nNot Underlined
\n'); + }); + + it('should interrupt paragraphs if using "start" property', () => { + const underline = { + extensions: [{ + name: 'underline', + level: 'block', + start(src) { return src.match(/:/)?.index; }, + tokenizer(src) { + const rule = /^:([^\n]*):(?:\n|$)/; + const match = rule.exec(src); + if (match) { + return { + type: 'underline', + raw: match[0], // This is the text that you want your token to consume from the source + text: match[1].trim() // You can add additional properties to your tokens to pass along to the renderer + }; + } + }, + renderer(token) { + return `${token.text}\n`; + } + }] + }; + marked.use(underline); + const html = marked('Not Underlined A\n:Underlined B:\nNot Underlined C\n:Not Underlined D'); + expect(html).toBe('Not Underlined A
\nUnderlined B\nNot Underlined C\n:Not Underlined D
\n'); + }); + + it('should use custom inline tokenizer + renderer extensions', () => { + const underline = { + name: 'underline', + level: 'inline', + start(src) { return src.match(/=/)?.index; }, + tokenizer(src) { + const rule = /^=([^=]+)=/; + const match = rule.exec(src); + if (match) { + return { + type: 'underline', + raw: match[0], // This is the text that you want your token to consume from the source + text: match[1].trim() // You can add additional properties to your tokens to pass along to the renderer + }; + } + }, + renderer(token) { + return `${token.text}`; + } + }; + marked.use({ extensions: [underline] }); + const html = marked('Not Underlined =Underlined= Not Underlined'); + expect(html).toBe('Not Underlined Underlined Not Underlined
\n'); + }); + + it('should handle interacting block and inline extensions', () => { + const descriptionlist = { + name: 'descriptionList', + level: 'block', + start(src) { return src.match(/:[^:\n]/)?.index; }, + tokenizer(src, tokens) { + const rule = /^(?::[^:\n]+:[^:\n]*(?:\n|$))+/; + const match = rule.exec(src); + if (match) { + return { + type: 'descriptionList', + raw: match[0], // This is the text that you want your token to consume from the source + text: match[0].trim(), // You can add additional properties to your tokens to pass along to the renderer + tokens: this.inlineTokens(match[0].trim()) + }; + } + }, + renderer(token) { + return `A Description List with One Description:
\n' + + 'test
\n<div></div>
\n'); + }); + + it('should handle renderers that return false', () => { + const extension = { + name: 'test', + level: 'block', + tokenizer(src) { + const rule = /^:([^\n]*):(?:\n|$)/; + const match = rule.exec(src); + if (match) { + return { + type: 'test', + raw: match[0], // This is the text that you want your token to consume from the source + text: match[1].trim() // You can add additional properties to your tokens to pass along to the renderer + }; + } + }, + renderer(token) { + if (token.text === 'test') { + return 'test'; + } + return false; + } + }; + const fallbackRenderer = { + name: 'test', + level: 'block', + renderer(token) { + if (token.text === 'Test') { + return 'fallback'; + } + return false; + } + }; + marked.use({ extensions: [fallbackRenderer, extension] }); + const html = marked(':Test:\n\n:test:\n\n:none:'); + expect(html).toBe('fallbacktest'); + }); + + it('should fall back when tokenizers return false', () => { + const extension = { + name: 'test', + level: 'block', + tokenizer(src) { + const rule = /^:([^\n]*):(?:\n|$)/; + const match = rule.exec(src); + if (match) { + return { + type: 'test', + raw: match[0], // This is the text that you want your token to consume from the source + text: match[1].trim() // You can add additional properties to your tokens to pass along to the renderer + }; + } + return false; + }, + renderer(token) { + return token.text; + } + }; + const extension2 = { + name: 'test', + level: 'block', + tokenizer(src) { + const rule = /^:([^\n]*):(?:\n|$)/; + const match = rule.exec(src); + if (match) { + if (match[1].match(/^[A-Z]/)) { + return { + type: 'test', + raw: match[0], + text: match[1].trim().toUpperCase() + }; + } + } + return false; + } + }; + marked.use({ extensions: [extension, extension2] }); + const html = marked(':Test:\n\n:test:'); + expect(html).toBe('TESTtest'); + }); + + it('should override original tokenizer/renderer with same name, but fall back if returns false', () => { + const extension = { + extensions: [{ + name: 'heading', + level: 'block', + tokenizer(src) { + return false; // fall back to default `heading` tokenizer + }, + renderer(token) { + return 'extension2 TOKENIZER EXTENSION\n
\n');
+ });
+
+ it('should walk only specified child tokens', () => {
+ const walkableDescription = {
+ extensions: [{
+ name: 'walkableDescription',
+ level: 'inline',
+ start(src) { return src.match(/:/)?.index; },
+ tokenizer(src, tokens) {
+ const rule = /^:([^:\n]+):([^:\n]*)(?:\n|$)/;
+ const match = rule.exec(src);
+ if (match) {
+ return {
+ type: 'walkableDescription',
+ raw: match[0], // This is the text that you want your token to consume from the source
+ dt: this.inlineTokens(match[1].trim()), // You can add additional properties to your tokens to pass along to the renderer
+ dd: this.inlineTokens(match[2].trim()),
+ tokens: this.inlineTokens('unwalked')
+ };
+ }
+ },
+ renderer(token) {
+ return `\n\n
used extension1 walked +used extension2 walked
+This is a paragraph with blue text.
\n' + + ''
- + (escaped ? code : escape$2(code, true))
+ + (escaped ? code : escape$1(code, true))
+ '
\n';
}
return ''
- + (escaped ? code : escape$2(code, true))
+ + (escaped ? code : escape$1(code, true))
+ '
\n';
}
@@ -2032,11 +2035,11 @@ var Renderer_1 = class Renderer {
}
link(href, title, text) {
- href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
+ href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text;
}
- let out = 'An error occurred:' - + escape$3(e.message + '', true) + + escape(e.message + '', true) + ''; } throw e; @@ -2562,42 +2578,53 @@ function marked(src, opt, callback) { marked.options = marked.setOptions = function(opt) { - merge$2(marked.defaults, opt); + merge(marked.defaults, opt); changeDefaults(marked.defaults); return marked; }; marked.getDefaults = getDefaults; -marked.defaults = defaults$5; +marked.defaults = defaults; /** * Use Extension */ -marked.use = function(extension) { - if (!Array.isArray(extension)) { // Wrap in array if not already to unify processing - extension = [extension]; - } - - const opts = merge$2({}, ...extension); - const extensions = marked.defaults.extensions || { renderers: {}, walkableTokens: {} }; +marked.use = function(...args) { + const opts = merge({}, ...args); + const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} }; let hasExtensions; - extension.forEach((pack) => { + args.forEach((pack) => { // ==-- Parse "addon" extensions --== // if (pack.extensions) { hasExtensions = true; pack.extensions.forEach((ext) => { - if (ext.renderer && ext.name) { // Renderers must have 'name' property - extensions.renderers[ext.name] = ext.renderer; - } - if (ext.walkableTokens && ext.name) { // walkableTokens must have 'name' - extensions.walkableTokens[ext.name] = ext.walkableTokens; + if (!ext.name) { + throw new Error('extension name required'); + } + if (ext.renderer) { // Renderer extensions + const prevRenderer = extensions.renderers?.[ext.name]; + if (prevRenderer) { + // Replace extension with func to run new extension but fall back if false + extensions.renderers[ext.name] = function(...args) { + let ret = ext.renderer.apply(this, args); + if (ret === false) { + ret = prevRenderer.apply(this, args); + } + return ret; + }; + } else { + extensions.renderers[ext.name] = ext.renderer; + } } - if (ext.tokenizer && ext.level) { // Tokenizers must have 'level' property + if (ext.tokenizer) { // Tokenizer Extensions + if (!ext.level || (ext.level !== 'block' && ext.level !== 'inline')) { + throw new Error("extension level must be 'block' or 'inline'"); + } if (extensions[ext.level]) { - extensions[ext.level].push(ext.tokenizer); + extensions[ext.level].unshift(ext.tokenizer); } else { extensions[ext.level] = [ext.tokenizer]; } @@ -2617,15 +2644,18 @@ marked.use = function(extension) { } } } + if (ext.childTokens) { // Child tokens to be visited by walkTokens + extensions.childTokens[ext.name] = ext.childTokens; + } }); } // ==-- Parse "overwrite" extensions --== // if (pack.renderer) { - const renderer = marked.defaults.renderer || new Renderer_1(); + const renderer = marked.defaults.renderer || new Renderer(); for (const prop in pack.renderer) { const prevRenderer = renderer[prop]; - // Replace renderer with func to run extension, but fall back if fail + // Replace renderer with func to run extension, but fall back if false renderer[prop] = (...args) => { let ret = pack.renderer[prop].apply(renderer, args); if (ret === false) { @@ -2637,10 +2667,10 @@ marked.use = function(extension) { opts.renderer = renderer; } if (pack.tokenizer) { - const tokenizer = marked.defaults.tokenizer || new Tokenizer_1(); + const tokenizer = marked.defaults.tokenizer || new Tokenizer(); for (const prop in pack.tokenizer) { const prevTokenizer = tokenizer[prop]; - // Replace tokenizer with func to run extension, but fall back if fail + // Replace tokenizer with func to run extension, but fall back if false tokenizer[prop] = (...args) => { let ret = pack.tokenizer[prop].apply(tokenizer, args); if (ret === false) { @@ -2656,7 +2686,7 @@ marked.use = function(extension) { if (pack.walkTokens) { const walkTokens = marked.defaults.walkTokens; opts.walkTokens = (token) => { - pack.walkTokens(token); + pack.walkTokens.call(this, token); if (walkTokens) { walkTokens(token); } @@ -2695,12 +2725,12 @@ marked.walkTokens = function(tokens, callback) { break; } default: { - if (marked.defaults?.extensions?.walkableTokens?.[token.type]) { // Walk any extensions - marked.defaults?.extensions.walkableTokens[token.type].forEach(function(walkableTokens) { - marked.walkTokens(token[walkableTokens], callback); + if (marked.defaults?.extensions?.childTokens?.[token.type]) { // Walk any extensions + marked.defaults?.extensions.childTokens[token.type].forEach(function(childTokens) { + marked.walkTokens(token[childTokens], callback); }); } - if (token.tokens && !marked.defaults?.extensions?.walkableTokens[token.type]?.tokens) { + if (token.tokens && !marked.defaults?.extensions?.childTokens[token.type]) { marked.walkTokens(token.tokens, callback); } } @@ -2721,8 +2751,8 @@ marked.parseInline = function(src, opt) { + Object.prototype.toString.call(src) + ', string expected'); } - opt = merge$2({}, marked.defaults, opt || {}); - checkSanitizeDeprecation$1(opt); + opt = merge({}, marked.defaults, opt || {}); + checkSanitizeDeprecation(opt); try { const tokens = Lexer.lexInline(src, opt); @@ -2734,7 +2764,7 @@ marked.parseInline = function(src, opt) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if (opt.silent) { return '
An error occurred:
' - + escape$3(e.message + '', true) + + escape(e.message + '', true) + ''; } throw e; diff --git a/lib/marked.js b/lib/marked.js index 70bbc77f88..33c196e8fd 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -75,6 +75,7 @@ return { baseUrl: null, breaks: false, + extensions: null, gfm: true, headerIds: true, headerPrefix: '', @@ -1458,6 +1459,8 @@ ; _proto.blockTokens = function blockTokens(src, tokens, top) { + var _this = this; + if (tokens === void 0) { tokens = []; } @@ -1470,10 +1473,24 @@ src = src.replace(/^ +$/gm, ''); } - var token, i, l, lastToken; + var token, i, l, lastToken, cutSrc, lastParagraphClipped; while (src) { - // newline + var _this$options, _this$options$extensi, _this$options$extensi2; + + if ((_this$options = this.options) != null && (_this$options$extensi = _this$options.extensions) != null && _this$options$extensi.block && this.options.extensions.block.some(function (extTokenizer) { + if (token = extTokenizer.call(_this, src, tokens)) { + src = src.substring(token.raw.length); + tokens.push(token); + return true; + } + + return false; + })) { + continue; + } // newline + + if (token = this.tokenizer.space(src)) { src = src.substring(token.raw.length); @@ -1582,11 +1599,43 @@ tokens.push(token); continue; } // top-level paragraph + // prevent paragraph consuming extensions by clipping 'src' to extension start + + + cutSrc = src; + + if ((_this$options$extensi2 = this.options.extensions) != null && _this$options$extensi2.startBlock) { + (function () { + var startIndex = Infinity; + var tempSrc = src.slice(1); + var tempStart = void 0; + + _this.options.extensions.startBlock.forEach(function (getStartIndex) { + tempStart = getStartIndex.call(this, tempSrc); + + if (typeof tempStart === 'number' && tempStart >= 0) { + startIndex = Math.min(startIndex, tempStart); + } + }); + + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + })(); + } + + if (top && (token = this.tokenizer.paragraph(cutSrc))) { + lastToken = tokens[tokens.length - 1]; + if (lastParagraphClipped && lastToken.type === 'paragraph') { + lastToken.raw += '\n' + token.raw; + lastToken.text += '\n' + token.text; + } else { + tokens.push(token); + } - if (top && (token = this.tokenizer.paragraph(src))) { + lastParagraphClipped = cutSrc.length !== src.length; src = src.substring(token.raw.length); - tokens.push(token); continue; } // text @@ -1694,6 +1743,8 @@ ; _proto.inlineTokens = function inlineTokens(src, tokens, inLink, inRawBlock) { + var _this2 = this; + if (tokens === void 0) { tokens = []; } @@ -1706,7 +1757,7 @@ inRawBlock = false; } - var token, lastToken; // String with links masked to avoid interference with em and strong + var token, lastToken, cutSrc; // String with links masked to avoid interference with em and strong var maskedSrc = src; var match; @@ -1735,11 +1786,26 @@ } while (src) { + var _this$options2, _this$options2$extens, _this$options$extensi3; + if (!keepPrevChar) { prevChar = ''; } - keepPrevChar = false; // escape + keepPrevChar = false; // extensions + + if ((_this$options2 = this.options) != null && (_this$options2$extens = _this$options2.extensions) != null && _this$options2$extens.inline && this.options.extensions.inline.some(function (extTokenizer) { + if (token = extTokenizer.call(_this2, src, tokens)) { + src = src.substring(token.raw.length); + tokens.push(token); + return true; + } + + return false; + })) { + continue; + } // escape + if (token = this.tokenizer.escape(src)) { src = src.substring(token.raw.length); @@ -1752,11 +1818,11 @@ src = src.substring(token.raw.length); inLink = token.inLink; inRawBlock = token.inRawBlock; - var _lastToken = tokens[tokens.length - 1]; + lastToken = tokens[tokens.length - 1]; - if (_lastToken && token.type === 'text' && _lastToken.type === 'text') { - _lastToken.raw += token.raw; - _lastToken.text += token.text; + if (lastToken && token.type === 'text' && lastToken.type === 'text') { + lastToken.raw += token.raw; + lastToken.text += token.text; } else { tokens.push(token); } @@ -1779,14 +1845,14 @@ if (token = this.tokenizer.reflink(src, this.tokens.links)) { src = src.substring(token.raw.length); - var _lastToken2 = tokens[tokens.length - 1]; + lastToken = tokens[tokens.length - 1]; if (token.type === 'link') { token.tokens = this.inlineTokens(token.text, [], true, inRawBlock); tokens.push(token); - } else if (_lastToken2 && token.type === 'text' && _lastToken2.type === 'text') { - _lastToken2.raw += token.raw; - _lastToken2.text += token.text; + } else if (lastToken && token.type === 'text' && lastToken.type === 'text') { + lastToken.raw += token.raw; + lastToken.text += token.text; } else { tokens.push(token); } @@ -1837,9 +1903,32 @@ tokens.push(token); continue; } // text + // prevent inlineText consuming extensions by clipping 'src' to extension start - if (token = this.tokenizer.inlineText(src, inRawBlock, smartypants)) { + cutSrc = src; + + if ((_this$options$extensi3 = this.options.extensions) != null && _this$options$extensi3.startInline) { + (function () { + var startIndex = Infinity; + var tempSrc = src.slice(1); + var tempStart = void 0; + + _this2.options.extensions.startInline.forEach(function (getStartIndex) { + tempStart = getStartIndex.call(this, tempSrc); + + if (typeof tempStart === 'number' && tempStart >= 0) { + startIndex = Math.min(startIndex, tempStart); + } + }); + + if (startIndex < Infinity && startIndex >= 0) { + cutSrc = src.substring(0, startIndex + 1); + } + })(); + } + + if (token = this.tokenizer.inlineText(cutSrc, inRawBlock, smartypants)) { src = src.substring(token.raw.length); if (token.raw.slice(-1) !== '_') { @@ -2215,11 +2304,23 @@ item, checked, task, - checkbox; + checkbox, + ret; var l = tokens.length; for (i = 0; i < l; i++) { - token = tokens[i]; + var _this$options$extensi, _this$options$extensi2; + + token = tokens[i]; // Run any renderer extensions + + if ((_this$options$extensi = this.options.extensions) != null && (_this$options$extensi2 = _this$options$extensi.renderers) != null && _this$options$extensi2[token.type]) { + ret = this.options.extensions.renderers[token.type].call(this, token); + + if (ret !== false || !['space', 'hr', 'heading', 'code', 'table', 'blockquote', 'list', 'html', 'paragraph', 'text'].includes(token.type)) { + out += ret || ''; + continue; + } + } switch (token.type) { case 'space': @@ -2383,11 +2484,23 @@ renderer = renderer || this.renderer; var out = '', i, - token; + token, + ret; var l = tokens.length; for (i = 0; i < l; i++) { - token = tokens[i]; + var _this$options$extensi3, _this$options$extensi4; + + token = tokens[i]; // Run any renderer extensions + + if ((_this$options$extensi3 = this.options.extensions) != null && (_this$options$extensi4 = _this$options$extensi3.renderers) != null && _this$options$extensi4[token.type]) { + ret = this.options.extensions.renderers[token.type].call(this, token); + + if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) { + out += ret || ''; + continue; + } + } switch (token.type) { case 'escape': @@ -2606,82 +2719,171 @@ * Use Extension */ - marked.use = function (extension) { - var opts = merge({}, extension); + marked.use = function () { + var _this = this; - if (extension.renderer) { - (function () { - var renderer = marked.defaults.renderer || new Renderer(); + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var opts = merge.apply(void 0, [{}].concat(args)); + var extensions = marked.defaults.extensions || { + renderers: {}, + childTokens: {} + }; + var hasExtensions; + args.forEach(function (pack) { + // ==-- Parse "addon" extensions --== // + if (pack.extensions) { + hasExtensions = true; + pack.extensions.forEach(function (ext) { + if (!ext.name) { + throw new Error('extension name required'); + } + + if (ext.renderer) { + var _extensions$renderers; + + // Renderer extensions + var prevRenderer = (_extensions$renderers = extensions.renderers) == null ? void 0 : _extensions$renderers[ext.name]; + + if (prevRenderer) { + // Replace extension with func to run new extension but fall back if false + extensions.renderers[ext.name] = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } - var _loop = function _loop(prop) { - var prevRenderer = renderer[prop]; + var ret = ext.renderer.apply(this, args); - renderer[prop] = function () { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + if (ret === false) { + ret = prevRenderer.apply(this, args); + } + + return ret; + }; + } else { + extensions.renderers[ext.name] = ext.renderer; + } + } + + if (ext.tokenizer) { + // Tokenizer Extensions + if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') { + throw new Error("extension level must be 'block' or 'inline'"); } - var ret = extension.renderer[prop].apply(renderer, args); + if (extensions[ext.level]) { + extensions[ext.level].unshift(ext.tokenizer); + } else { + extensions[ext.level] = [ext.tokenizer]; + } - if (ret === false) { - ret = prevRenderer.apply(renderer, args); + if (ext.start) { + // Function to check for start of token + if (ext.level === 'block') { + if (extensions.startBlock) { + extensions.startBlock.push(ext.start); + } else { + extensions.startBlock = [ext.start]; + } + } else if (ext.level === 'inline') { + if (extensions.startInline) { + extensions.startInline.push(ext.start); + } else { + extensions.startInline = [ext.start]; + } + } } + } + + if (ext.childTokens) { + // Child tokens to be visited by walkTokens + extensions.childTokens[ext.name] = ext.childTokens; + } + }); + } // ==-- Parse "overwrite" extensions --== // + + + if (pack.renderer) { + (function () { + var renderer = marked.defaults.renderer || new Renderer(); - return ret; + var _loop = function _loop(prop) { + var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false + + renderer[prop] = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + var ret = pack.renderer[prop].apply(renderer, args); + + if (ret === false) { + ret = prevRenderer.apply(renderer, args); + } + + return ret; + }; }; - }; - for (var prop in extension.renderer) { - _loop(prop); - } + for (var prop in pack.renderer) { + _loop(prop); + } - opts.renderer = renderer; - })(); - } + opts.renderer = renderer; + })(); + } - if (extension.tokenizer) { - (function () { - var tokenizer = marked.defaults.tokenizer || new Tokenizer(); + if (pack.tokenizer) { + (function () { + var tokenizer = marked.defaults.tokenizer || new Tokenizer(); - var _loop2 = function _loop2(prop) { - var prevTokenizer = tokenizer[prop]; + var _loop2 = function _loop2(prop) { + var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false - tokenizer[prop] = function () { - for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } + tokenizer[prop] = function () { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } - var ret = extension.tokenizer[prop].apply(tokenizer, args); + var ret = pack.tokenizer[prop].apply(tokenizer, args); - if (ret === false) { - ret = prevTokenizer.apply(tokenizer, args); - } + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args); + } - return ret; + return ret; + }; }; - }; - for (var prop in extension.tokenizer) { - _loop2(prop); - } + for (var prop in pack.tokenizer) { + _loop2(prop); + } - opts.tokenizer = tokenizer; - })(); - } + opts.tokenizer = tokenizer; + })(); + } // ==-- Parse WalkTokens extensions --== // - if (extension.walkTokens) { - var walkTokens = marked.defaults.walkTokens; - opts.walkTokens = function (token) { - extension.walkTokens(token); + if (pack.walkTokens) { + var walkTokens = marked.defaults.walkTokens; - if (walkTokens) { - walkTokens(token); - } - }; - } + opts.walkTokens = function (token) { + pack.walkTokens.call(_this, token); - marked.setOptions(opts); + if (walkTokens) { + walkTokens(token); + } + }; + } + + if (hasExtensions) { + opts.extensions = extensions; + } + + marked.setOptions(opts); + }); }; /** * Run callback for every token @@ -2689,7 +2891,7 @@ marked.walkTokens = function (tokens, callback) { - for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { + var _loop3 = function _loop3() { var token = _step.value; callback(token); @@ -2721,11 +2923,26 @@ default: { - if (token.tokens) { + var _marked$defaults, _marked$defaults$exte, _marked$defaults$exte2, _marked$defaults3, _marked$defaults3$ext; + + if ((_marked$defaults = marked.defaults) != null && (_marked$defaults$exte = _marked$defaults.extensions) != null && (_marked$defaults$exte2 = _marked$defaults$exte.childTokens) != null && _marked$defaults$exte2[token.type]) { + var _marked$defaults2; + + // Walk any extensions + (_marked$defaults2 = marked.defaults) == null ? void 0 : _marked$defaults2.extensions.childTokens[token.type].forEach(function (childTokens) { + marked.walkTokens(token[childTokens], callback); + }); + } + + if (token.tokens && !((_marked$defaults3 = marked.defaults) != null && (_marked$defaults3$ext = _marked$defaults3.extensions) != null && _marked$defaults3$ext.childTokens[token.type])) { marked.walkTokens(token.tokens, callback); } } } + }; + + for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { + _loop3(); } }; /** diff --git a/marked.min.js b/marked.min.js index 0cda8aba71..75f53e547d 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e,u){"object"==typeof exports&&"undefined"!=typeof module?module.exports=u():"function"==typeof define&&define.amd?define(u):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=u()}(this,function(){"use strict";function r(e,u){for(var t=0;t
'+(t?e:H(e,!0))+"
\n":""+(t?e:H(e,!0))+"
\n"},u.blockquote=function(e){return"\n"+e+"\n"},u.html=function(e){return e},u.heading=function(e,u,t,n){return this.options.headerIds?"
"+e+"
\n"},u.table=function(e,u){return""+e+"
"},u.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=y,ae.defaults=b,ae.use=function(l){var u,t=re({},l);l.renderer&&function(){var e,s=ae.defaults.renderer||new ne;for(e in l.renderer)!function(r){var i=s[r];s[r]=function(){for(var e=arguments.length,u=new Array(e),t=0;t
"+se(e.message+"",!0)+"";throw e}},ae.Parser=ue,ae.parser=ue.parse,ae.Renderer=ne,ae.TextRenderer=_,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=te,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,u){"object"==typeof exports&&"undefined"!=typeof module?module.exports=u():"function"==typeof define&&define.amd?define(u):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=u()}(this,function(){"use strict";function r(e,u){for(var t=0;t
'+(t?e:H(e,!0))+"
\n":""+(t?e:H(e,!0))+"
\n"},u.blockquote=function(e){return"\n"+e+"\n"},u.html=function(e){return e},u.heading=function(e,u,t,n){return this.options.headerIds?"
"+e+"
\n"},u.table=function(e,u){return""+e+"
"},u.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var t=this,e=arguments.length,u=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=ue,ae.parser=ue.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=te,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file From a86701fd7c19085aab8296a1c8ab17041957842a Mon Sep 17 00:00:00 2001 From: semantic-release-bot
'+(t?e:H(e,!0))+"
\n":""+(t?e:H(e,!0))+"
\n"},u.blockquote=function(e){return"\n"+e+"\n"},u.html=function(e){return e},u.heading=function(e,u,t,n){return this.options.headerIds?"
"+e+"
\n"},u.table=function(e,u){return""+e+"
"},u.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var t=this,e=arguments.length,u=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=ue,ae.parser=ue.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=te,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u
'+(u?e:H(e,!0))+"
\n":""+(u?e:H(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file From a2af658aa2043eb1e3be191317b98f1ae0b5bfbe Mon Sep 17 00:00:00 2001 From: semantic-release-bot
extensions
extensions
foo\tbaz\t\tbim\n
\n",
"example": 1,
- "start_line": 352,
- "end_line": 357,
+ "start_line": 356,
+ "end_line": 361,
"section": "Tabs"
},
{
"markdown": " \tfoo\tbaz\t\tbim\n",
"html": "foo\tbaz\t\tbim\n
\n",
"example": 2,
- "start_line": 359,
- "end_line": 364,
+ "start_line": 363,
+ "end_line": 368,
"section": "Tabs"
},
{
"markdown": " a\ta\n ὐ\ta\n",
"html": "a\ta\nὐ\ta\n
\n",
"example": 3,
- "start_line": 366,
- "end_line": 373,
+ "start_line": 370,
+ "end_line": 377,
"section": "Tabs"
},
{
"markdown": " - foo\n\n\tbar\n",
"html": "foo
\nbar
\nfoo
\n bar\n
\n\n\n", "example": 6, - "start_line": 415, - "end_line": 422, + "start_line": 419, + "end_line": 426, "section": "Tabs" }, { "markdown": "-\t\tfoo\n", "html": "\nfoo\n
foo\n
\nfoo\nbar\n
\n",
"example": 8,
- "start_line": 436,
- "end_line": 443,
+ "start_line": 440,
+ "end_line": 447,
"section": "Tabs"
},
{
"markdown": " - foo\n - bar\n\t - baz\n",
"html": "!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~
\n", "example": 12, - "start_line": 496, + "start_line": 490, + "end_line": 494, + "section": "Backslash escapes" + }, + { + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "html": "\\\t\\A\\a\\ \\3\\φ\\«
\n", + "example": 13, + "start_line": 500, "end_line": 504, + "section": "Backslash escapes" + }, + { + "markdown": "\\*not emphasized*\n\\*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\nö not a character entity
\n", + "example": 14, + "start_line": 510, + "end_line": 530, + "section": "Backslash escapes" + }, + { + "markdown": "\\\\*emphasis*\n", + "html": "\\emphasis
\n", + "example": 15, + "start_line": 535, + "end_line": 539, + "section": "Backslash escapes" + }, + { + "markdown": "foo\\\nbar\n", + "html": "foo
\nbar
\\[\\`
\\[\\]\n
\n",
+ "example": 18,
+ "start_line": 563,
+ "end_line": 568,
+ "section": "Backslash escapes"
+ },
+ {
+ "markdown": "~~~\n\\[\\]\n~~~\n",
+ "html": "\\[\\]\n
\n",
+ "example": 19,
+ "start_line": 571,
+ "end_line": 578,
+ "section": "Backslash escapes"
+ },
+ {
+ "markdown": "foo\n
\n",
+ "example": 24,
+ "start_line": 614,
+ "end_line": 621,
+ "section": "Backslash escapes",
+ "shouldFail": true
+ },
+ {
+ "markdown": " & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n",
+ "html": "& © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸
\n", + "example": 25, + "start_line": 650, + "end_line": 658, + "section": "Entity and numeric character references" + }, + { + "markdown": "# Ӓ Ϡ \n", + "html": "# Ӓ Ϡ �
\n", + "example": 26, + "start_line": 669, + "end_line": 673, + "section": "Entity and numeric character references" + }, + { + "markdown": "" ആ ಫ\n", + "html": "" ആ ಫ
\n", + "example": 27, + "start_line": 682, + "end_line": 686, + "section": "Entity and numeric character references" + }, + { + "markdown": "  &x; \n\nabcdef0;\n&ThisIsNotDefined; &hi?;\n", + "html": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;
\n", + "example": 28, + "start_line": 691, + "end_line": 701, + "section": "Entity and numeric character references", + "shouldFail": true + }, + { + "markdown": "©\n", + "html": "©
\n", + "example": 29, + "start_line": 708, + "end_line": 712, + "section": "Entity and numeric character references" + }, + { + "markdown": "&MadeUpEntity;\n", + "html": "&MadeUpEntity;
\n", + "example": 30, + "start_line": 718, + "end_line": 722, + "section": "Entity and numeric character references" + }, + { + "markdown": "\n", + "html": "\n", + "example": 31, + "start_line": 729, + "end_line": 733, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo](/föö \"föö\")\n", + "html": "\n", + "example": 32, + "start_line": 736, + "end_line": 740, + "section": "Entity and numeric character references", + "shouldFail": true + }, + { + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "html": "\n", + "example": 33, + "start_line": 743, + "end_line": 749, + "section": "Entity and numeric character references", + "shouldFail": true + }, + { + "markdown": "``` föö\nfoo\n```\n", + "html": "foo\n
\n",
+ "example": 34,
+ "start_line": 752,
+ "end_line": 759,
+ "section": "Entity and numeric character references",
+ "shouldFail": true
+ },
+ {
+ "markdown": "`föö`\n",
+ "html": "föö
föfö\n
\n",
+ "example": 36,
+ "start_line": 772,
+ "end_line": 777,
+ "section": "Entity and numeric character references"
+ },
+ {
+ "markdown": "*foo*\n*foo*\n",
+ "html": "*foo*\nfoo
\n", + "example": 37, + "start_line": 784, + "end_line": 790, + "section": "Entity and numeric character references" + }, + { + "markdown": "* foo\n\n* foo\n", + "html": "* foo
\nfoo\n\nbar
\n", + "example": 39, + "start_line": 803, + "end_line": 809, + "section": "Entity and numeric character references" + }, + { + "markdown": " foo\n", + "html": "\tfoo
\n", + "example": 40, + "start_line": 811, + "end_line": 815, + "section": "Entity and numeric character references" + }, + { + "markdown": "[a](url "tit")\n", + "html": "[a](url "tit")
\n", + "example": 41, + "start_line": 818, + "end_line": 822, + "section": "Entity and numeric character references" + }, + { + "markdown": "- `one\n- two`\n", + "html": "+++
\n", - "example": 14, - "start_line": 548, - "end_line": 552, + "example": 44, + "start_line": 893, + "end_line": 897, "section": "Thematic breaks" }, { "markdown": "===\n", "html": "===
\n", - "example": 15, - "start_line": 555, - "end_line": 559, + "example": 45, + "start_line": 900, + "end_line": 904, "section": "Thematic breaks" }, { "markdown": "--\n**\n__\n", "html": "--\n**\n__
\n", - "example": 16, - "start_line": 564, - "end_line": 572, + "example": 46, + "start_line": 909, + "end_line": 917, "section": "Thematic breaks" }, { "markdown": " ***\n ***\n ***\n", "html": "***\n
\n",
- "example": 18,
- "start_line": 590,
- "end_line": 595,
+ "example": 48,
+ "start_line": 935,
+ "end_line": 940,
"section": "Thematic breaks"
},
{
"markdown": "Foo\n ***\n",
"html": "Foo\n***
\n", - "example": 19, - "start_line": 598, - "end_line": 604, + "example": 49, + "start_line": 943, + "end_line": 949, "section": "Thematic breaks" }, { "markdown": "_____________________________________\n", "html": "_ _ _ _ a
\na------
\n---a---
\n", - "example": 25, - "start_line": 650, - "end_line": 660, + "example": 55, + "start_line": 995, + "end_line": 1005, "section": "Thematic breaks" }, { "markdown": " *-*\n", "html": "-
\n", - "example": 26, - "start_line": 666, - "end_line": 670, + "example": 56, + "start_line": 1011, + "end_line": 1015, "section": "Thematic breaks" }, { "markdown": "- foo\n***\n- bar\n", "html": "Foo
\nbar
\n", - "example": 28, - "start_line": 692, - "end_line": 700, + "example": 58, + "start_line": 1037, + "end_line": 1045, "section": "Thematic breaks" }, { "markdown": "Foo\n---\nbar\n", "html": "bar
\n", - "example": 29, - "start_line": 709, - "end_line": 716, + "example": 59, + "start_line": 1054, + "end_line": 1061, "section": "Thematic breaks" }, { "markdown": "* Foo\n* * *\n* Bar\n", "html": "####### foo
\n", - "example": 33, - "start_line": 787, - "end_line": 791, + "example": 63, + "start_line": 1132, + "end_line": 1136, "section": "ATX headings" }, { "markdown": "#5 bolt\n\n#hashtag\n", "html": "#5 bolt
\n#hashtag
\n", - "example": 34, - "start_line": 802, - "end_line": 809, + "example": 64, + "start_line": 1147, + "end_line": 1154, "section": "ATX headings" }, { "markdown": "\\## foo\n", "html": "## foo
\n", - "example": 35, - "start_line": 814, - "end_line": 818, + "example": 65, + "start_line": 1159, + "end_line": 1163, "section": "ATX headings" }, { "markdown": "# foo *bar* \\*baz\\*\n", "html": "# foo\n
\n",
- "example": 39,
- "start_line": 854,
- "end_line": 859,
+ "example": 69,
+ "start_line": 1199,
+ "end_line": 1204,
"section": "ATX headings"
},
{
"markdown": "foo\n # bar\n",
"html": "foo\n# bar
\n", - "example": 40, - "start_line": 862, - "end_line": 868, + "example": 70, + "start_line": 1207, + "end_line": 1213, "section": "ATX headings" }, { "markdown": "## foo ##\n ### bar ###\n", "html": "Foo bar
\nBar foo
\n", - "example": 48, - "start_line": 950, - "end_line": 958, + "example": 78, + "start_line": 1295, + "end_line": 1303, "section": "ATX headings" }, { "markdown": "## \n#\n### ###\n", "html": "\n\n\n", - "example": 49, - "start_line": 963, - "end_line": 971, + "example": 79, + "start_line": 1308, + "end_line": 1316, "section": "ATX headings" }, { "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", "html": "Foo\n---\n\nFoo\n
\nFoo\n---
\n", - "example": 57, - "start_line": 1108, - "end_line": 1114, + "example": 87, + "start_line": 1453, + "end_line": 1459, "section": "Setext headings" }, { "markdown": "Foo\n= =\n\nFoo\n--- -\n", "html": "Foo\n= =
\nFoo
\n`
\nof dashes"/>
\n", - "example": 61, - "start_line": 1156, - "end_line": 1169, + "example": 91, + "start_line": 1501, + "end_line": 1514, "section": "Setext headings" }, { "markdown": "> Foo\n---\n", "html": "\n\nFoo
\n
\n\n", - "example": 63, - "start_line": 1186, - "end_line": 1196, + "example": 93, + "start_line": 1531, + "end_line": 1541, "section": "Setext headings" }, { "markdown": "- Foo\n---\n", "html": "foo\nbar\n===
\n
Baz
\n", - "example": 66, - "start_line": 1227, - "end_line": 1239, + "example": 96, + "start_line": 1572, + "end_line": 1584, "section": "Setext headings" }, { "markdown": "\n====\n", "html": "====
\n", - "example": 67, - "start_line": 1244, - "end_line": 1249, + "example": 97, + "start_line": 1589, + "end_line": 1594, "section": "Setext headings" }, { "markdown": "---\n---\n", "html": "foo\n
\n\n\nfoo
\n
Foo
\nbaz
\n", - "example": 73, - "start_line": 1331, - "end_line": 1341, + "example": 103, + "start_line": 1676, + "end_line": 1686, "section": "Setext headings" }, { "markdown": "Foo\nbar\n\n---\n\nbaz\n", "html": "Foo\nbar
\nbaz
\n", - "example": 74, - "start_line": 1347, - "end_line": 1359, + "example": 104, + "start_line": 1692, + "end_line": 1704, "section": "Setext headings" }, { "markdown": "Foo\nbar\n* * *\nbaz\n", "html": "Foo\nbar
\nbaz
\n", - "example": 75, - "start_line": 1365, - "end_line": 1375, + "example": 105, + "start_line": 1710, + "end_line": 1720, "section": "Setext headings" }, { "markdown": "Foo\nbar\n\\---\nbaz\n", "html": "Foo\nbar\n---\nbaz
\n", - "example": 76, - "start_line": 1380, - "end_line": 1390, + "example": 106, + "start_line": 1725, + "end_line": 1735, "section": "Setext headings" }, { "markdown": " a simple\n indented code block\n", "html": "a simple\n indented code block\n
\n",
- "example": 77,
- "start_line": 1408,
- "end_line": 1415,
+ "example": 107,
+ "start_line": 1753,
+ "end_line": 1760,
"section": "Indented code blocks"
},
{
"markdown": " - foo\n\n bar\n",
"html": "foo
\nbar
\nfoo
\n<a/>\n*hi*\n\n- one\n
\n",
- "example": 80,
- "start_line": 1456,
- "end_line": 1467,
+ "example": 110,
+ "start_line": 1801,
+ "end_line": 1812,
"section": "Indented code blocks"
},
{
"markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n",
"html": "chunk1\n\nchunk2\n\n\n\nchunk3\n
\n",
- "example": 81,
- "start_line": 1472,
- "end_line": 1489,
+ "example": 111,
+ "start_line": 1817,
+ "end_line": 1834,
"section": "Indented code blocks"
},
{
"markdown": " chunk1\n \n chunk2\n",
"html": "chunk1\n \n chunk2\n
\n",
- "example": 82,
- "start_line": 1495,
- "end_line": 1504,
+ "example": 112,
+ "start_line": 1840,
+ "end_line": 1849,
"section": "Indented code blocks"
},
{
"markdown": "Foo\n bar\n\n",
"html": "Foo\nbar
\n", - "example": 83, - "start_line": 1510, - "end_line": 1517, + "example": 113, + "start_line": 1855, + "end_line": 1862, "section": "Indented code blocks" }, { "markdown": " foo\nbar\n", "html": "foo\n
\nbar
\n", - "example": 84, - "start_line": 1524, - "end_line": 1531, + "example": 114, + "start_line": 1869, + "end_line": 1876, "section": "Indented code blocks" }, { "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", "html": "foo\n
\nfoo\n
\n foo\nbar\n
\n",
- "example": 86,
- "start_line": 1557,
- "end_line": 1564,
+ "example": 116,
+ "start_line": 1902,
+ "end_line": 1909,
"section": "Indented code blocks"
},
{
"markdown": "\n \n foo\n \n\n",
"html": "foo\n
\n",
- "example": 87,
- "start_line": 1570,
- "end_line": 1579,
+ "example": 117,
+ "start_line": 1915,
+ "end_line": 1924,
"section": "Indented code blocks"
},
{
"markdown": " foo \n",
"html": "foo \n
\n",
- "example": 88,
- "start_line": 1584,
- "end_line": 1589,
+ "example": 118,
+ "start_line": 1929,
+ "end_line": 1934,
"section": "Indented code blocks"
},
{
"markdown": "```\n<\n >\n```\n",
"html": "<\n >\n
\n",
- "example": 89,
- "start_line": 1639,
- "end_line": 1648,
+ "example": 119,
+ "start_line": 1984,
+ "end_line": 1993,
"section": "Fenced code blocks"
},
{
"markdown": "~~~\n<\n >\n~~~\n",
"html": "<\n >\n
\n",
- "example": 90,
- "start_line": 1653,
- "end_line": 1662,
+ "example": 120,
+ "start_line": 1998,
+ "end_line": 2007,
"section": "Fenced code blocks"
},
{
"markdown": "``\nfoo\n``\n",
"html": "foo
aaa\n~~~\n
\n",
- "example": 92,
- "start_line": 1677,
- "end_line": 1686,
+ "example": 122,
+ "start_line": 2022,
+ "end_line": 2031,
"section": "Fenced code blocks"
},
{
"markdown": "~~~\naaa\n```\n~~~\n",
"html": "aaa\n```\n
\n",
- "example": 93,
- "start_line": 1689,
- "end_line": 1698,
+ "example": 123,
+ "start_line": 2034,
+ "end_line": 2043,
"section": "Fenced code blocks"
},
{
"markdown": "````\naaa\n```\n``````\n",
"html": "aaa\n```\n
\n",
- "example": 94,
- "start_line": 1703,
- "end_line": 1712,
+ "example": 124,
+ "start_line": 2048,
+ "end_line": 2057,
"section": "Fenced code blocks"
},
{
"markdown": "~~~~\naaa\n~~~\n~~~~\n",
"html": "aaa\n~~~\n
\n",
- "example": 95,
- "start_line": 1715,
- "end_line": 1724,
+ "example": 125,
+ "start_line": 2060,
+ "end_line": 2069,
"section": "Fenced code blocks"
},
{
"markdown": "```\n",
"html": "
\n",
- "example": 96,
- "start_line": 1730,
- "end_line": 1734,
+ "example": 126,
+ "start_line": 2075,
+ "end_line": 2079,
"section": "Fenced code blocks"
},
{
"markdown": "`````\n\n```\naaa\n",
"html": "\n```\naaa\n
\n",
- "example": 97,
- "start_line": 1737,
- "end_line": 1747,
+ "example": 127,
+ "start_line": 2082,
+ "end_line": 2092,
"section": "Fenced code blocks"
},
{
"markdown": "> ```\n> aaa\n\nbbb\n",
"html": "\n\n\naaa\n
bbb
\n", - "example": 98, - "start_line": 1750, - "end_line": 1761, + "example": 128, + "start_line": 2095, + "end_line": 2106, "section": "Fenced code blocks" }, { "markdown": "```\n\n \n```\n", "html": "\n \n
\n",
- "example": 99,
- "start_line": 1766,
- "end_line": 1775,
+ "example": 129,
+ "start_line": 2111,
+ "end_line": 2120,
"section": "Fenced code blocks"
},
{
"markdown": "```\n```\n",
"html": "
\n",
- "example": 100,
- "start_line": 1780,
- "end_line": 1785,
+ "example": 130,
+ "start_line": 2125,
+ "end_line": 2130,
"section": "Fenced code blocks"
},
{
"markdown": " ```\n aaa\naaa\n```\n",
"html": "aaa\naaa\n
\n",
- "example": 101,
- "start_line": 1792,
- "end_line": 1801,
+ "example": 131,
+ "start_line": 2137,
+ "end_line": 2146,
"section": "Fenced code blocks"
},
{
"markdown": " ```\naaa\n aaa\naaa\n ```\n",
"html": "aaa\naaa\naaa\n
\n",
- "example": 102,
- "start_line": 1804,
- "end_line": 1815,
+ "example": 132,
+ "start_line": 2149,
+ "end_line": 2160,
"section": "Fenced code blocks"
},
{
"markdown": " ```\n aaa\n aaa\n aaa\n ```\n",
"html": "aaa\n aaa\naaa\n
\n",
- "example": 103,
- "start_line": 1818,
- "end_line": 1829,
+ "example": 133,
+ "start_line": 2163,
+ "end_line": 2174,
"section": "Fenced code blocks"
},
{
"markdown": " ```\n aaa\n ```\n",
"html": "```\naaa\n```\n
\n",
- "example": 104,
- "start_line": 1834,
- "end_line": 1843,
+ "example": 134,
+ "start_line": 2179,
+ "end_line": 2188,
"section": "Fenced code blocks"
},
{
"markdown": "```\naaa\n ```\n",
"html": "aaa\n
\n",
- "example": 105,
- "start_line": 1849,
- "end_line": 1856,
+ "example": 135,
+ "start_line": 2194,
+ "end_line": 2201,
"section": "Fenced code blocks"
},
{
"markdown": " ```\naaa\n ```\n",
"html": "aaa\n
\n",
- "example": 106,
- "start_line": 1859,
- "end_line": 1866,
+ "example": 136,
+ "start_line": 2204,
+ "end_line": 2211,
"section": "Fenced code blocks"
},
{
"markdown": "```\naaa\n ```\n",
"html": "aaa\n ```\n
\n",
- "example": 107,
- "start_line": 1871,
- "end_line": 1879,
+ "example": 137,
+ "start_line": 2216,
+ "end_line": 2224,
"section": "Fenced code blocks"
},
{
"markdown": "``` ```\naaa\n",
"html": "
\naaa
aaa\n~~~ ~~\n
\n",
- "example": 109,
- "start_line": 1894,
- "end_line": 1902,
+ "example": 139,
+ "start_line": 2239,
+ "end_line": 2247,
"section": "Fenced code blocks"
},
{
"markdown": "foo\n```\nbar\n```\nbaz\n",
"html": "foo
\nbar\n
\nbaz
\n", - "example": 110, - "start_line": 1908, - "end_line": 1919, + "example": 140, + "start_line": 2253, + "end_line": 2264, "section": "Fenced code blocks" }, { "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", "html": "bar\n
\ndef foo(x)\n return 3\nend\n
\n",
- "example": 112,
- "start_line": 1947,
- "end_line": 1958,
+ "example": 142,
+ "start_line": 2292,
+ "end_line": 2303,
"section": "Fenced code blocks"
},
{
"markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n",
"html": "def foo(x)\n return 3\nend\n
\n",
- "example": 113,
- "start_line": 1961,
- "end_line": 1972,
+ "example": 143,
+ "start_line": 2306,
+ "end_line": 2317,
"section": "Fenced code blocks"
},
{
"markdown": "````;\n````\n",
"html": "
\n",
- "example": 114,
- "start_line": 1975,
- "end_line": 1980,
+ "example": 144,
+ "start_line": 2320,
+ "end_line": 2325,
"section": "Fenced code blocks"
},
{
"markdown": "``` aa ```\nfoo\n",
"html": "aa
\nfoo
foo\n
\n",
- "example": 116,
- "start_line": 1996,
- "end_line": 2003,
+ "example": 146,
+ "start_line": 2341,
+ "end_line": 2348,
"section": "Fenced code blocks"
},
{
"markdown": "```\n``` aaa\n```\n",
"html": "``` aaa\n
\n",
- "example": 117,
- "start_line": 2008,
- "end_line": 2015,
+ "example": 147,
+ "start_line": 2353,
+ "end_line": 2360,
"section": "Fenced code blocks"
},
{
"markdown": "\n\n**Hello**,\n\n_world_.\n\n |
\n\n**Hello**,\n\n |
\n hi\n | \n
\n hi\n | \n
okay.
\n", - "example": 119, - "start_line": 2116, - "end_line": 2135, + "example": 149, + "start_line": 2461, + "end_line": 2480, "section": "HTML blocks" }, { "markdown": "Markdown
\nbar
\n", - "example": 125, - "start_line": 2201, - "end_line": 2210, + "example": 155, + "start_line": 2546, + "end_line": 2555, "section": "HTML blocks" }, { "markdown": "\n", "html": "\n", - "example": 129, - "start_line": 2250, - "end_line": 2254, + "example": 159, + "start_line": 2595, + "end_line": 2599, "section": "HTML blocks" }, { "markdown": "\nfoo\n |
\nfoo\n |
foo
\nfoo
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n",
"html": "\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay
\n", - "example": 139, - "start_line": 2390, - "end_line": 2406, + "example": 169, + "start_line": 2735, + "end_line": 2751, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 140, - "start_line": 2411, - "end_line": 2425, + "example": 170, + "start_line": 2756, + "end_line": 2770, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 171, + "start_line": 2775, + "end_line": 2791, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 141, - "start_line": 2430, - "end_line": 2446, + "example": 172, + "start_line": 2795, + "end_line": 2811, "section": "HTML blocks" }, { "markdown": "\n*foo*\n", "html": "\nfoo
\n", - "example": 145, - "start_line": 2495, - "end_line": 2501, + "example": 176, + "start_line": 2860, + "end_line": 2866, "section": "HTML blocks" }, { "markdown": "*bar*\n*baz*\n", "html": "*bar*\nbaz
\n", - "example": 146, - "start_line": 2504, - "end_line": 2510, + "example": 177, + "start_line": 2869, + "end_line": 2875, "section": "HTML blocks" }, { "markdown": "1. *bar*\n", "html": "1. *bar*\n", - "example": 147, - "start_line": 2516, - "end_line": 2524, + "example": 178, + "start_line": 2881, + "end_line": 2889, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 148, - "start_line": 2529, - "end_line": 2541, + "example": 179, + "start_line": 2894, + "end_line": 2906, "section": "HTML blocks" }, { "markdown": "';\n\n?>\nokay\n", "html": "';\n\n?>\nokay
\n", - "example": 149, - "start_line": 2547, - "end_line": 2561, + "example": 180, + "start_line": 2912, + "end_line": 2926, "section": "HTML blocks" }, { "markdown": "\n", "html": "\n", - "example": 150, - "start_line": 2566, - "end_line": 2570, + "example": 181, + "start_line": 2931, + "end_line": 2935, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 151, - "start_line": 2575, - "end_line": 2603, + "example": 182, + "start_line": 2940, + "end_line": 2968, "section": "HTML blocks" }, { "markdown": " \n\n \n", "html": " \n<!-- foo -->\n
\n",
- "example": 152,
- "start_line": 2608,
- "end_line": 2616,
+ "example": 183,
+ "start_line": 2974,
+ "end_line": 2982,
"section": "HTML blocks"
},
{
"markdown": " <div>\n
\n",
- "example": 153,
- "start_line": 2619,
- "end_line": 2627,
+ "example": 184,
+ "start_line": 2985,
+ "end_line": 2993,
"section": "HTML blocks"
},
{
"markdown": "Foo\nFoo
\nFoo\n\nbaz
\n", - "example": 156, - "start_line": 2665, - "end_line": 2673, + "example": 187, + "start_line": 3031, + "end_line": 3039, "section": "HTML blocks" }, { "markdown": "Emphasized text.
\n\nHi\n | \n\n
\nHi\n | \n
\n Hi\n | \n\n
[foo]: /url 'title
\nwith blank line'
\n[foo]
\n", - "example": 166, - "start_line": 2877, - "end_line": 2887, + "example": 197, + "start_line": 3244, + "end_line": 3254, "section": "Link reference definitions" }, { "markdown": "[foo]:\n/url\n\n[foo]\n", "html": "\n", - "example": 167, - "start_line": 2892, - "end_line": 2899, + "example": 198, + "start_line": 3259, + "end_line": 3266, "section": "Link reference definitions" }, { "markdown": "[foo]:\n\n[foo]\n", "html": "[foo]:
\n[foo]
\n", - "example": 168, - "start_line": 2904, - "end_line": 2911, + "example": 199, + "start_line": 3271, + "end_line": 3278, "section": "Link reference definitions" }, { "markdown": "[foo]: <>\n\n[foo]\n", "html": "\n", - "example": 169, - "start_line": 2916, - "end_line": 2922, + "example": 200, + "start_line": 3283, + "end_line": 3289, "section": "Link reference definitions", "shouldFail": true }, { "markdown": "[foo]:[foo]:
[foo]
\n", - "example": 170, - "start_line": 2927, - "end_line": 2934, + "example": 201, + "start_line": 3294, + "end_line": 3301, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", "html": "\n", - "example": 171, - "start_line": 2940, - "end_line": 2946, + "example": 202, + "start_line": 3307, + "end_line": 3313, "section": "Link reference definitions", "shouldFail": true }, { "markdown": "[foo]\n\n[foo]: url\n", "html": "\n", - "example": 172, - "start_line": 2951, - "end_line": 2957, + "example": 203, + "start_line": 3318, + "end_line": 3324, "section": "Link reference definitions" }, { "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", "html": "\n", - "example": 173, - "start_line": 2963, - "end_line": 2970, + "example": 204, + "start_line": 3330, + "end_line": 3337, "section": "Link reference definitions" }, { "markdown": "[FOO]: /url\n\n[Foo]\n", "html": "\n", - "example": 174, - "start_line": 2976, - "end_line": 2982, + "example": 205, + "start_line": 3343, + "end_line": 3349, "section": "Link reference definitions" }, { "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", "html": "\n", - "example": 175, - "start_line": 2985, - "end_line": 2991, + "example": 206, + "start_line": 3352, + "end_line": 3358, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\n", "html": "", - "example": 176, - "start_line": 2997, - "end_line": 3000, + "example": 207, + "start_line": 3367, + "end_line": 3370, "section": "Link reference definitions" }, { "markdown": "[\nfoo\n]: /url\nbar\n", "html": "bar
\n", - "example": 177, - "start_line": 3005, - "end_line": 3012, + "example": 208, + "start_line": 3375, + "end_line": 3382, "section": "Link reference definitions" }, { "markdown": "[foo]: /url \"title\" ok\n", "html": "[foo]: /url "title" ok
\n", - "example": 178, - "start_line": 3018, - "end_line": 3022, + "example": 209, + "start_line": 3388, + "end_line": 3392, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\n\"title\" ok\n", "html": ""title" ok
\n", - "example": 179, - "start_line": 3027, - "end_line": 3032, + "example": 210, + "start_line": 3397, + "end_line": 3402, "section": "Link reference definitions" }, { "markdown": " [foo]: /url \"title\"\n\n[foo]\n", "html": "[foo]: /url "title"\n
\n[foo]
\n", - "example": 180, - "start_line": 3038, - "end_line": 3046, + "example": 211, + "start_line": 3408, + "end_line": 3416, "section": "Link reference definitions" }, { "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", "html": "[foo]: /url\n
\n[foo]
\n", - "example": 181, - "start_line": 3052, - "end_line": 3062, + "example": 212, + "start_line": 3422, + "end_line": 3432, "section": "Link reference definitions" }, { "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", "html": "Foo\n[bar]: /baz
\n[bar]
\n", - "example": 182, - "start_line": 3067, - "end_line": 3076, + "example": 213, + "start_line": 3437, + "end_line": 3446, "section": "Link reference definitions" }, { "markdown": "# [Foo]\n[foo]: /url\n> bar\n", "html": "\n\n", - "example": 183, - "start_line": 3082, - "end_line": 3091, + "example": 214, + "start_line": 3452, + "end_line": 3461, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\nbar\n===\n[foo]\n", "html": "bar
\n
===\nfoo
\n", - "example": 185, - "start_line": 3103, - "end_line": 3110, + "example": 216, + "start_line": 3473, + "end_line": 3480, "section": "Link reference definitions" }, { "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", "html": "\n", - "example": 186, - "start_line": 3116, - "end_line": 3129, + "example": 217, + "start_line": 3486, + "end_line": 3499, "section": "Link reference definitions" }, { "markdown": "[foo]\n\n> [foo]: /url\n", "html": "\n\n\n", - "example": 187, - "start_line": 3137, - "end_line": 3145, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\n", - "html": "", - "example": 188, - "start_line": 3154, - "end_line": 3157, + "example": 218, + "start_line": 3507, + "end_line": 3515, "section": "Link reference definitions" }, { "markdown": "aaa\n\nbbb\n", "html": "
aaa
\nbbb
\n", - "example": 189, - "start_line": 3171, - "end_line": 3178, + "example": 219, + "start_line": 3529, + "end_line": 3536, "section": "Paragraphs" }, { "markdown": "aaa\nbbb\n\nccc\nddd\n", "html": "aaa\nbbb
\nccc\nddd
\n", - "example": 190, - "start_line": 3183, - "end_line": 3194, + "example": 220, + "start_line": 3541, + "end_line": 3552, "section": "Paragraphs" }, { "markdown": "aaa\n\n\nbbb\n", "html": "aaa
\nbbb
\n", - "example": 191, - "start_line": 3199, - "end_line": 3207, + "example": 221, + "start_line": 3557, + "end_line": 3565, "section": "Paragraphs" }, { "markdown": " aaa\n bbb\n", "html": "aaa\nbbb
\n", - "example": 192, - "start_line": 3212, - "end_line": 3218, + "example": 222, + "start_line": 3570, + "end_line": 3576, "section": "Paragraphs" }, { "markdown": "aaa\n bbb\n ccc\n", "html": "aaa\nbbb\nccc
\n", - "example": 193, - "start_line": 3224, - "end_line": 3232, + "example": 223, + "start_line": 3582, + "end_line": 3590, "section": "Paragraphs" }, { "markdown": " aaa\nbbb\n", "html": "aaa\nbbb
\n", - "example": 194, - "start_line": 3238, - "end_line": 3244, + "example": 224, + "start_line": 3596, + "end_line": 3602, "section": "Paragraphs" }, { "markdown": " aaa\nbbb\n", "html": "aaa\n
\nbbb
\n", - "example": 195, - "start_line": 3247, - "end_line": 3254, + "example": 225, + "start_line": 3605, + "end_line": 3612, "section": "Paragraphs" }, { "markdown": "aaa \nbbb \n", "html": "aaa
\nbbb
aaa
\n\n\n", - "example": 198, - "start_line": 3344, - "end_line": 3354, + "example": 228, + "start_line": 3704, + "end_line": 3714, "section": "Block quotes" }, { "markdown": "># Foo\n>bar\n> baz\n", "html": "Foo
\nbar\nbaz
\n
\n\n", - "example": 199, - "start_line": 3359, - "end_line": 3369, + "example": 229, + "start_line": 3719, + "end_line": 3729, "section": "Block quotes" }, { "markdown": " > # Foo\n > bar\n > baz\n", "html": "Foo
\nbar\nbaz
\n
\n\n", - "example": 200, - "start_line": 3374, - "end_line": 3384, + "example": 230, + "start_line": 3734, + "end_line": 3744, "section": "Block quotes" }, { "markdown": " > # Foo\n > bar\n > baz\n", "html": "Foo
\nbar\nbaz
\n
> # Foo\n> bar\n> baz\n
\n",
- "example": 201,
- "start_line": 3389,
- "end_line": 3398,
+ "example": 231,
+ "start_line": 3749,
+ "end_line": 3758,
"section": "Block quotes"
},
{
"markdown": "> # Foo\n> bar\nbaz\n",
"html": "\n\n", - "example": 202, - "start_line": 3404, - "end_line": 3414, + "example": 232, + "start_line": 3764, + "end_line": 3774, "section": "Block quotes" }, { "markdown": "> bar\nbaz\n> foo\n", "html": "Foo
\nbar\nbaz
\n
\n\n", - "example": 203, - "start_line": 3420, - "end_line": 3430, + "example": 233, + "start_line": 3780, + "end_line": 3790, "section": "Block quotes" }, { "markdown": "> foo\n---\n", "html": "bar\nbaz\nfoo
\n
\n\nfoo
\n
\n\n\n
\n- foo
\n
\n\n\nfoo\n
bar\n
\n",
- "example": 206,
- "start_line": 3482,
- "end_line": 3492,
+ "example": 236,
+ "start_line": 3842,
+ "end_line": 3852,
"section": "Block quotes",
"shouldFail": true
},
{
"markdown": "> ```\nfoo\n```\n",
"html": "\n\n\n
foo
\n
\n",
- "example": 207,
- "start_line": 3495,
- "end_line": 3505,
+ "example": 237,
+ "start_line": 3855,
+ "end_line": 3865,
"section": "Block quotes",
"shouldFail": true
},
{
"markdown": "> foo\n - bar\n",
"html": "\n\n", - "example": 208, - "start_line": 3511, - "end_line": 3519, + "example": 238, + "start_line": 3871, + "end_line": 3879, "section": "Block quotes" }, { "markdown": ">\n", "html": "foo\n- bar
\n
\n\n", - "example": 209, - "start_line": 3535, - "end_line": 3540, + "example": 239, + "start_line": 3895, + "end_line": 3900, "section": "Block quotes" }, { "markdown": ">\n> \n> \n", "html": "
\n\n", - "example": 210, - "start_line": 3543, - "end_line": 3550, + "example": 240, + "start_line": 3903, + "end_line": 3910, "section": "Block quotes" }, { "markdown": ">\n> foo\n> \n", "html": "
\n\n", - "example": 211, - "start_line": 3555, - "end_line": 3563, + "example": 241, + "start_line": 3915, + "end_line": 3923, "section": "Block quotes" }, { "markdown": "> foo\n\n> bar\n", "html": "foo
\n
\n\nfoo
\n
\n\n", - "example": 212, - "start_line": 3568, - "end_line": 3579, + "example": 242, + "start_line": 3928, + "end_line": 3939, "section": "Block quotes" }, { "markdown": "> foo\n> bar\n", "html": "bar
\n
\n\n", - "example": 213, - "start_line": 3590, - "end_line": 3598, + "example": 243, + "start_line": 3950, + "end_line": 3958, "section": "Block quotes" }, { "markdown": "> foo\n>\n> bar\n", "html": "foo\nbar
\n
\n\n", - "example": 214, - "start_line": 3603, - "end_line": 3612, + "example": 244, + "start_line": 3963, + "end_line": 3972, "section": "Block quotes" }, { "markdown": "foo\n> bar\n", "html": "foo
\nbar
\n
foo
\n\n\n", - "example": 215, - "start_line": 3617, - "end_line": 3625, + "example": 245, + "start_line": 3977, + "end_line": 3985, "section": "Block quotes" }, { "markdown": "> aaa\n***\n> bbb\n", "html": "bar
\n
\n\naaa
\n
\n\n", - "example": 216, - "start_line": 3631, - "end_line": 3643, + "example": 246, + "start_line": 3991, + "end_line": 4003, "section": "Block quotes" }, { "markdown": "> bar\nbaz\n", "html": "bbb
\n
\n\n", - "example": 217, - "start_line": 3649, - "end_line": 3657, + "example": 247, + "start_line": 4009, + "end_line": 4017, "section": "Block quotes" }, { "markdown": "> bar\n\nbaz\n", "html": "bar\nbaz
\n
\n\nbar
\n
baz
\n", - "example": 218, - "start_line": 3660, - "end_line": 3669, + "example": 248, + "start_line": 4020, + "end_line": 4029, "section": "Block quotes" }, { "markdown": "> bar\n>\nbaz\n", "html": "\n\nbar
\n
baz
\n", - "example": 219, - "start_line": 3672, - "end_line": 3681, + "example": 249, + "start_line": 4032, + "end_line": 4041, "section": "Block quotes" }, { "markdown": "> > > foo\nbar\n", "html": "\n\n", - "example": 220, - "start_line": 3688, - "end_line": 3700, + "example": 250, + "start_line": 4048, + "end_line": 4060, "section": "Block quotes" }, { "markdown": ">>> foo\n> bar\n>>baz\n", "html": "\n\n\n\nfoo\nbar
\n
\n\n", - "example": 221, - "start_line": 3703, - "end_line": 3717, + "example": 251, + "start_line": 4063, + "end_line": 4077, "section": "Block quotes" }, { "markdown": "> code\n\n> not code\n", "html": "\n\n\n\nfoo\nbar\nbaz
\n
\n\n\ncode\n
\n\n", - "example": 222, - "start_line": 3725, - "end_line": 3737, + "example": 252, + "start_line": 4085, + "end_line": 4097, "section": "Block quotes" }, { "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", "html": "not code
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\n", - "example": 223, - "start_line": 3779, - "end_line": 3794, + "example": 253, + "start_line": 4139, + "end_line": 4154, "section": "List items" }, { "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", "html": "A block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
two
\n", - "example": 225, - "start_line": 3834, - "end_line": 3843, + "example": 255, + "start_line": 4194, + "end_line": 4203, "section": "List items" }, { "markdown": "- one\n\n two\n", "html": "one
\ntwo
\n two\n
\n",
- "example": 227,
- "start_line": 3860,
- "end_line": 3870,
+ "example": 257,
+ "start_line": 4220,
+ "end_line": 4230,
"section": "List items"
},
{
"markdown": " - one\n\n two\n",
"html": "one
\ntwo
\n\n\n", - "example": 229, - "start_line": 3895, - "end_line": 3910, + "example": 259, + "start_line": 4255, + "end_line": 4270, "section": "List items" }, { "markdown": ">>- one\n>>\n > > two\n", "html": "\n\n\n
\n- \n
\none
\ntwo
\n
\n\n", - "example": 230, - "start_line": 3922, - "end_line": 3935, + "example": 260, + "start_line": 4282, + "end_line": 4295, "section": "List items" }, { "markdown": "-one\n\n2.two\n", "html": "\n\n\n
\n- one
\ntwo
\n
-one
\n2.two
\n", - "example": 231, - "start_line": 3941, - "end_line": 3948, + "example": 261, + "start_line": 4301, + "end_line": 4308, "section": "List items" }, { "markdown": "- foo\n\n\n bar\n", "html": "foo
\nbar
\nfoo
\nbar\n
\nbaz
\n\n\nbam
\n
Foo
\nbar\n\n\nbaz\n
\n1234567890. not ok
\n", - "example": 236, - "start_line": 4030, - "end_line": 4034, + "example": 266, + "start_line": 4390, + "end_line": 4394, "section": "List items" }, { "markdown": "0. ok\n", "html": "-1. not ok
\n", - "example": 239, - "start_line": 4059, - "end_line": 4063, + "example": 269, + "start_line": 4419, + "end_line": 4423, "section": "List items" }, { "markdown": "- foo\n\n bar\n", "html": "foo
\nbar\n
\nfoo
\nbar\n
\nindented code\n
\nparagraph
\nmore code\n
\n",
- "example": 242,
- "start_line": 4118,
- "end_line": 4130,
+ "example": 272,
+ "start_line": 4478,
+ "end_line": 4490,
"section": "List items"
},
{
"markdown": "1. indented code\n\n paragraph\n\n more code\n",
"html": "indented code\n
\nparagraph
\nmore code\n
\n indented code\n
\nparagraph
\nmore code\n
\nfoo
\nbar
\n", - "example": 245, - "start_line": 4182, - "end_line": 4189, + "example": 275, + "start_line": 4542, + "end_line": 4549, "section": "List items" }, { "markdown": "- foo\n\n bar\n", "html": "bar
\n", - "example": 246, - "start_line": 4192, - "end_line": 4201, + "example": 276, + "start_line": 4552, + "end_line": 4561, "section": "List items" }, { "markdown": "- foo\n\n bar\n", "html": "foo
\nbar
\nbar\n
\nbaz\n
\nfoo
\n", - "example": 250, - "start_line": 4277, - "end_line": 4286, + "example": 280, + "start_line": 4636, + "end_line": 4645, "section": "List items", "shouldFail": true }, { "markdown": "- foo\n-\n- bar\n", "html": "foo\n*
\nfoo\n1.
\n", - "example": 255, - "start_line": 4346, - "end_line": 4357, + "example": 285, + "start_line": 4705, + "end_line": 4716, "section": "List items" }, { "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n
\n",
- "example": 259,
- "start_line": 4440,
- "end_line": 4455,
+ "example": 289,
+ "start_line": 4799,
+ "end_line": 4814,
"section": "List items"
},
{
"markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n",
"html": "A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
\n\n", - "example": 262, - "start_line": 4507, - "end_line": 4521, + "example": 292, + "start_line": 4866, + "end_line": 4880, "section": "List items" }, { "markdown": "> 1. > Blockquote\n> continued here.\n", "html": "\n
\n- \n
\n\n\nBlockquote\ncontinued here.
\n
\n\n", - "example": 263, - "start_line": 4524, - "end_line": 4538, + "example": 293, + "start_line": 4883, + "end_line": 4897, "section": "List items" }, { "markdown": "- foo\n - bar\n - baz\n - boo\n", "html": "\n
\n- \n
\n\n\nBlockquote\ncontinued here.
\n
Foo
\nThe number of windows in my house is\n14. The number of doors is 6.
\n", - "example": 274, - "start_line": 5005, - "end_line": 5011, + "example": 304, + "start_line": 5364, + "end_line": 5370, "section": "Lists" }, { "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", "html": "The number of windows in my house is
\nfoo
\nbar
\nbaz
\nbaz
\nbim
\nfoo
\nnotcode
\nfoo
\ncode\n
\n",
- "example": 279,
- "start_line": 5101,
- "end_line": 5124,
+ "example": 309,
+ "start_line": 5460,
+ "end_line": 5483,
"section": "Lists"
},
{
"markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n",
"html": "a
\nb
\nc
\na
\nb
\n3. c\n
\n",
- "example": 283,
- "start_line": 5197,
- "end_line": 5214,
+ "example": 313,
+ "start_line": 5556,
+ "end_line": 5573,
"section": "Lists"
},
{
"markdown": "- a\n- b\n\n- c\n",
"html": "a
\nb
\nc
\na
\nc
\na
\nb
\nc
\nd
\na
\nb
\nd
\nb\n\n\n
\nb
\nc
\n\n\nb
\n
\n\nb
\n
c\n
\nfoo\n
\nbar
\nfoo
\nbaz
\na
\nd
\nhi
lo`
!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~
\n", - "example": 298, - "start_line": 5513, - "end_line": 5517, - "section": "Backslash escapes" - }, - { - "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", - "html": "\\\t\\A\\a\\ \\3\\φ\\«
\n", - "example": 299, - "start_line": 5523, - "end_line": 5527, - "section": "Backslash escapes" - }, - { - "markdown": "\\*not emphasized*\n\\*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\nö not a character entity
\n", - "example": 300, - "start_line": 5533, - "end_line": 5553, - "section": "Backslash escapes" - }, - { - "markdown": "\\\\*emphasis*\n", - "html": "\\emphasis
\n", - "example": 301, - "start_line": 5558, - "end_line": 5562, - "section": "Backslash escapes" - }, - { - "markdown": "foo\\\nbar\n", - "html": "foo
\nbar
\\[\\`
\\[\\]\n
\n",
- "example": 304,
- "start_line": 5586,
- "end_line": 5591,
- "section": "Backslash escapes"
- },
- {
- "markdown": "~~~\n\\[\\]\n~~~\n",
- "html": "\\[\\]\n
\n",
- "example": 305,
- "start_line": 5594,
- "end_line": 5601,
- "section": "Backslash escapes"
- },
- {
- "markdown": "foo\n
\n",
- "example": 310,
- "start_line": 5637,
- "end_line": 5644,
- "section": "Backslash escapes",
- "shouldFail": true
- },
- {
- "markdown": " & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n",
- "html": "& © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸
\n", - "example": 311, - "start_line": 5674, - "end_line": 5682, - "section": "Entity and numeric character references" - }, - { - "markdown": "# Ӓ Ϡ \n", - "html": "# Ӓ Ϡ �
\n", - "example": 312, - "start_line": 5693, - "end_line": 5697, - "section": "Entity and numeric character references" - }, - { - "markdown": "" ആ ಫ\n", - "html": "" ആ ಫ
\n", - "example": 313, - "start_line": 5706, - "end_line": 5710, - "section": "Entity and numeric character references" - }, - { - "markdown": "  &x; \n\nabcdef0;\n&ThisIsNotDefined; &hi?;\n", - "html": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;
\n", - "example": 314, - "start_line": 5715, - "end_line": 5725, - "section": "Entity and numeric character references", - "shouldFail": true - }, - { - "markdown": "©\n", - "html": "©
\n", - "example": 315, - "start_line": 5732, - "end_line": 5736, - "section": "Entity and numeric character references" - }, - { - "markdown": "&MadeUpEntity;\n", - "html": "&MadeUpEntity;
\n", - "example": 316, - "start_line": 5742, - "end_line": 5746, - "section": "Entity and numeric character references" - }, - { - "markdown": "\n", - "html": "\n", - "example": 317, - "start_line": 5753, - "end_line": 5757, - "section": "Entity and numeric character references" - }, - { - "markdown": "[foo](/föö \"föö\")\n", - "html": "\n", - "example": 318, - "start_line": 5760, - "end_line": 5764, - "section": "Entity and numeric character references", - "shouldFail": true - }, - { - "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", - "html": "\n", "example": 319, - "start_line": 5767, - "end_line": 5773, - "section": "Entity and numeric character references", + "start_line": 5694, + "end_line": 5712, + "section": "Lists", "shouldFail": true }, { - "markdown": "``` föö\nfoo\n```\n", - "html": "foo\n
\n",
+ "markdown": "* a\n > b\n >\n* c\n",
+ "html": "\n\nb
\n
föö
\n\nb
\n
c\n
\nföfö\n
\n",
+ "markdown": "- a\n",
+ "html": "*foo*\nfoo
\n", + "markdown": "- a\n - b\n", + "html": "* foo
\nfoo\n
\nbar
\nfoo\n\nbar
\n", + "markdown": "* foo\n * bar\n\n baz\n", + "html": "foo
\nbaz
\n\tfoo
\n", + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "html": "a
\nd
\n[a](url "tit")
\n", + "markdown": "`hi`lo`\n", + "html": "hi
lo`
foo
foo ` bar
``
``
a
b
\n
foo bar baz
foo
foo bar baz
foo\\
bar`
foo`bar
foo `` bar
*foo*
[not a link](/foo
)
<a href="
">`
<http://foo.bar.
baz>`
```foo``
\n", "example": 347, - "start_line": 6059, - "end_line": 6063, + "start_line": 6079, + "end_line": 6083, "section": "Code spans" }, { "markdown": "`foo\n", "html": "`foo
\n", "example": 348, - "start_line": 6066, - "end_line": 6070, + "start_line": 6086, + "end_line": 6090, "section": "Code spans" }, { "markdown": "`foo``bar``\n", "html": "`foobar
foo bar
\n", "example": 350, - "start_line": 6292, - "end_line": 6296, + "start_line": 6312, + "end_line": 6316, "section": "Emphasis and strong emphasis" }, { "markdown": "a * foo bar*\n", "html": "a * foo bar*
\n", "example": 351, - "start_line": 6302, - "end_line": 6306, + "start_line": 6322, + "end_line": 6326, "section": "Emphasis and strong emphasis" }, { "markdown": "a*\"foo\"*\n", "html": "a*"foo"*
\n", "example": 352, - "start_line": 6313, - "end_line": 6317, + "start_line": 6333, + "end_line": 6337, "section": "Emphasis and strong emphasis" }, { "markdown": "* a *\n", "html": "* a *
\n", "example": 353, - "start_line": 6322, - "end_line": 6326, + "start_line": 6342, + "end_line": 6346, "section": "Emphasis and strong emphasis" }, { "markdown": "foo*bar*\n", "html": "foobar
\n", "example": 354, - "start_line": 6331, - "end_line": 6335, + "start_line": 6351, + "end_line": 6355, "section": "Emphasis and strong emphasis" }, { "markdown": "5*6*78\n", "html": "5678
\n", "example": 355, - "start_line": 6338, - "end_line": 6342, + "start_line": 6358, + "end_line": 6362, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo bar_\n", "html": "foo bar
\n", "example": 356, - "start_line": 6347, - "end_line": 6351, + "start_line": 6367, + "end_line": 6371, "section": "Emphasis and strong emphasis" }, { "markdown": "_ foo bar_\n", "html": "_ foo bar_
\n", "example": 357, - "start_line": 6357, - "end_line": 6361, + "start_line": 6377, + "end_line": 6381, "section": "Emphasis and strong emphasis" }, { "markdown": "a_\"foo\"_\n", "html": "a_"foo"_
\n", "example": 358, - "start_line": 6367, - "end_line": 6371, + "start_line": 6387, + "end_line": 6391, "section": "Emphasis and strong emphasis" }, { "markdown": "foo_bar_\n", "html": "foo_bar_
\n", "example": 359, - "start_line": 6376, - "end_line": 6380, + "start_line": 6396, + "end_line": 6400, "section": "Emphasis and strong emphasis" }, { "markdown": "5_6_78\n", "html": "5_6_78
\n", "example": 360, - "start_line": 6383, - "end_line": 6387, + "start_line": 6403, + "end_line": 6407, "section": "Emphasis and strong emphasis" }, { "markdown": "пристаням_стремятся_\n", "html": "пристаням_стремятся_
\n", "example": 361, - "start_line": 6390, - "end_line": 6394, + "start_line": 6410, + "end_line": 6414, "section": "Emphasis and strong emphasis" }, { "markdown": "aa_\"bb\"_cc\n", "html": "aa_"bb"_cc
\n", "example": 362, - "start_line": 6400, - "end_line": 6404, + "start_line": 6420, + "end_line": 6424, "section": "Emphasis and strong emphasis" }, { "markdown": "foo-_(bar)_\n", "html": "foo-(bar)
\n", "example": 363, - "start_line": 6411, - "end_line": 6415, + "start_line": 6431, + "end_line": 6435, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo*\n", "html": "_foo*
\n", "example": 364, - "start_line": 6423, - "end_line": 6427, + "start_line": 6443, + "end_line": 6447, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo bar *\n", "html": "*foo bar *
\n", "example": 365, - "start_line": 6433, - "end_line": 6437, + "start_line": 6453, + "end_line": 6457, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo bar\n*\n", "html": "*foo bar\n*
\n", "example": 366, - "start_line": 6442, - "end_line": 6448, + "start_line": 6462, + "end_line": 6468, "section": "Emphasis and strong emphasis" }, { "markdown": "*(*foo)\n", "html": "*(*foo)
\n", "example": 367, - "start_line": 6455, - "end_line": 6459, + "start_line": 6475, + "end_line": 6479, "section": "Emphasis and strong emphasis" }, { "markdown": "*(*foo*)*\n", "html": "(foo)
\n", "example": 368, - "start_line": 6465, - "end_line": 6469, + "start_line": 6485, + "end_line": 6489, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo*bar\n", "html": "foobar
\n", "example": 369, - "start_line": 6474, - "end_line": 6478, + "start_line": 6494, + "end_line": 6498, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo bar _\n", "html": "_foo bar _
\n", "example": 370, - "start_line": 6487, - "end_line": 6491, + "start_line": 6507, + "end_line": 6511, "section": "Emphasis and strong emphasis" }, { "markdown": "_(_foo)\n", "html": "_(_foo)
\n", "example": 371, - "start_line": 6497, - "end_line": 6501, + "start_line": 6517, + "end_line": 6521, "section": "Emphasis and strong emphasis" }, { "markdown": "_(_foo_)_\n", "html": "(foo)
\n", "example": 372, - "start_line": 6506, - "end_line": 6510, + "start_line": 6526, + "end_line": 6530, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo_bar\n", "html": "_foo_bar
\n", "example": 373, - "start_line": 6515, - "end_line": 6519, + "start_line": 6535, + "end_line": 6539, "section": "Emphasis and strong emphasis" }, { "markdown": "_пристаням_стремятся\n", "html": "_пристаням_стремятся
\n", "example": 374, - "start_line": 6522, - "end_line": 6526, + "start_line": 6542, + "end_line": 6546, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo_bar_baz_\n", "html": "foo_bar_baz
\n", "example": 375, - "start_line": 6529, - "end_line": 6533, + "start_line": 6549, + "end_line": 6553, "section": "Emphasis and strong emphasis" }, { "markdown": "_(bar)_.\n", "html": "(bar).
\n", "example": 376, - "start_line": 6540, - "end_line": 6544, + "start_line": 6560, + "end_line": 6564, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo bar**\n", "html": "foo bar
\n", "example": 377, - "start_line": 6549, - "end_line": 6553, + "start_line": 6569, + "end_line": 6573, "section": "Emphasis and strong emphasis" }, { "markdown": "** foo bar**\n", "html": "** foo bar**
\n", "example": 378, - "start_line": 6559, - "end_line": 6563, + "start_line": 6579, + "end_line": 6583, "section": "Emphasis and strong emphasis" }, { "markdown": "a**\"foo\"**\n", "html": "a**"foo"**
\n", "example": 379, - "start_line": 6570, - "end_line": 6574, + "start_line": 6590, + "end_line": 6594, "section": "Emphasis and strong emphasis" }, { "markdown": "foo**bar**\n", "html": "foobar
\n", "example": 380, - "start_line": 6579, - "end_line": 6583, + "start_line": 6599, + "end_line": 6603, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo bar__\n", "html": "foo bar
\n", "example": 381, - "start_line": 6588, - "end_line": 6592, + "start_line": 6608, + "end_line": 6612, "section": "Emphasis and strong emphasis" }, { "markdown": "__ foo bar__\n", "html": "__ foo bar__
\n", "example": 382, - "start_line": 6598, - "end_line": 6602, + "start_line": 6618, + "end_line": 6622, "section": "Emphasis and strong emphasis" }, { "markdown": "__\nfoo bar__\n", "html": "__\nfoo bar__
\n", "example": 383, - "start_line": 6606, - "end_line": 6612, + "start_line": 6626, + "end_line": 6632, "section": "Emphasis and strong emphasis" }, { "markdown": "a__\"foo\"__\n", "html": "a__"foo"__
\n", "example": 384, - "start_line": 6618, - "end_line": 6622, + "start_line": 6638, + "end_line": 6642, "section": "Emphasis and strong emphasis" }, { "markdown": "foo__bar__\n", "html": "foo__bar__
\n", "example": 385, - "start_line": 6627, - "end_line": 6631, + "start_line": 6647, + "end_line": 6651, "section": "Emphasis and strong emphasis" }, { "markdown": "5__6__78\n", "html": "5__6__78
\n", "example": 386, - "start_line": 6634, - "end_line": 6638, + "start_line": 6654, + "end_line": 6658, "section": "Emphasis and strong emphasis" }, { "markdown": "пристаням__стремятся__\n", "html": "пристаням__стремятся__
\n", "example": 387, - "start_line": 6641, - "end_line": 6645, + "start_line": 6661, + "end_line": 6665, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo, __bar__, baz__\n", "html": "foo, bar, baz
\n", "example": 388, - "start_line": 6648, - "end_line": 6652, + "start_line": 6668, + "end_line": 6672, "section": "Emphasis and strong emphasis" }, { "markdown": "foo-__(bar)__\n", "html": "foo-(bar)
\n", "example": 389, - "start_line": 6659, - "end_line": 6663, + "start_line": 6679, + "end_line": 6683, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo bar **\n", "html": "**foo bar **
\n", "example": 390, - "start_line": 6672, - "end_line": 6676, + "start_line": 6692, + "end_line": 6696, "section": "Emphasis and strong emphasis" }, { "markdown": "**(**foo)\n", "html": "**(**foo)
\n", "example": 391, - "start_line": 6685, - "end_line": 6689, + "start_line": 6705, + "end_line": 6709, "section": "Emphasis and strong emphasis" }, { "markdown": "*(**foo**)*\n", "html": "(foo)
\n", "example": 392, - "start_line": 6695, - "end_line": 6699, + "start_line": 6715, + "end_line": 6719, "section": "Emphasis and strong emphasis" }, { "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", "html": "Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)
\n", "example": 393, - "start_line": 6702, - "end_line": 6708, + "start_line": 6722, + "end_line": 6728, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo \"*bar*\" foo**\n", "html": "foo "bar" foo
\n", "example": 394, - "start_line": 6711, - "end_line": 6715, + "start_line": 6731, + "end_line": 6735, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo**bar\n", "html": "foobar
\n", "example": 395, - "start_line": 6720, - "end_line": 6724, + "start_line": 6740, + "end_line": 6744, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo bar __\n", "html": "__foo bar __
\n", "example": 396, - "start_line": 6732, - "end_line": 6736, + "start_line": 6752, + "end_line": 6756, "section": "Emphasis and strong emphasis" }, { "markdown": "__(__foo)\n", "html": "__(__foo)
\n", "example": 397, - "start_line": 6742, - "end_line": 6746, + "start_line": 6762, + "end_line": 6766, "section": "Emphasis and strong emphasis" }, { "markdown": "_(__foo__)_\n", "html": "(foo)
\n", "example": 398, - "start_line": 6752, - "end_line": 6756, + "start_line": 6772, + "end_line": 6776, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__bar\n", "html": "__foo__bar
\n", "example": 399, - "start_line": 6761, - "end_line": 6765, + "start_line": 6781, + "end_line": 6785, "section": "Emphasis and strong emphasis" }, { "markdown": "__пристаням__стремятся\n", "html": "__пристаням__стремятся
\n", "example": 400, - "start_line": 6768, - "end_line": 6772, + "start_line": 6788, + "end_line": 6792, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__bar__baz__\n", "html": "foo__bar__baz
\n", "example": 401, - "start_line": 6775, - "end_line": 6779, + "start_line": 6795, + "end_line": 6799, "section": "Emphasis and strong emphasis" }, { "markdown": "__(bar)__.\n", "html": "(bar).
\n", "example": 402, - "start_line": 6786, - "end_line": 6790, + "start_line": 6806, + "end_line": 6810, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo [bar](/url)*\n", "html": "foo bar
\n", "example": 403, - "start_line": 6798, - "end_line": 6802, + "start_line": 6818, + "end_line": 6822, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo\nbar*\n", "html": "foo\nbar
\n", "example": 404, - "start_line": 6805, - "end_line": 6811, + "start_line": 6825, + "end_line": 6831, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo __bar__ baz_\n", "html": "foo bar baz
\n", "example": 405, - "start_line": 6817, - "end_line": 6821, + "start_line": 6837, + "end_line": 6841, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo _bar_ baz_\n", "html": "foo bar baz
\n", "example": 406, - "start_line": 6824, - "end_line": 6828, + "start_line": 6844, + "end_line": 6848, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo_ bar_\n", "html": "foo bar
\n", "example": 407, - "start_line": 6831, - "end_line": 6835, + "start_line": 6851, + "end_line": 6855, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo *bar**\n", "html": "foo bar
\n", "example": 408, - "start_line": 6838, - "end_line": 6842, + "start_line": 6858, + "end_line": 6862, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo **bar** baz*\n", "html": "foo bar baz
\n", "example": 409, - "start_line": 6845, - "end_line": 6849, + "start_line": 6865, + "end_line": 6869, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**bar**baz*\n", "html": "foobarbaz
\n", "example": 410, - "start_line": 6851, - "end_line": 6855, + "start_line": 6871, + "end_line": 6875, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**bar*\n", "html": "foo**bar
\n", "example": 411, - "start_line": 6875, - "end_line": 6879, + "start_line": 6895, + "end_line": 6899, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo** bar*\n", "html": "foo bar
\n", "example": 412, - "start_line": 6888, - "end_line": 6892, + "start_line": 6908, + "end_line": 6912, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo **bar***\n", "html": "foo bar
\n", "example": 413, - "start_line": 6895, - "end_line": 6899, + "start_line": 6915, + "end_line": 6919, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**bar***\n", "html": "foobar
\n", "example": 414, - "start_line": 6902, - "end_line": 6906, + "start_line": 6922, + "end_line": 6926, "section": "Emphasis and strong emphasis" }, { "markdown": "foo***bar***baz\n", "html": "foobarbaz
\n", "example": 415, - "start_line": 6913, - "end_line": 6917, + "start_line": 6933, + "end_line": 6937, "section": "Emphasis and strong emphasis" }, { "markdown": "foo******bar*********baz\n", "html": "foobar***baz
\n", "example": 416, - "start_line": 6919, - "end_line": 6923, + "start_line": 6939, + "end_line": 6943, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo **bar *baz* bim** bop*\n", "html": "foo bar baz bim bop
\n", "example": 417, - "start_line": 6928, - "end_line": 6932, + "start_line": 6948, + "end_line": 6952, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo [*bar*](/url)*\n", "html": "foo bar
\n", "example": 418, - "start_line": 6935, - "end_line": 6939, + "start_line": 6955, + "end_line": 6959, "section": "Emphasis and strong emphasis" }, { "markdown": "** is not an empty emphasis\n", "html": "** is not an empty emphasis
\n", "example": 419, - "start_line": 6944, - "end_line": 6948, + "start_line": 6964, + "end_line": 6968, "section": "Emphasis and strong emphasis" }, { "markdown": "**** is not an empty strong emphasis\n", "html": "**** is not an empty strong emphasis
\n", "example": 420, - "start_line": 6951, - "end_line": 6955, + "start_line": 6971, + "end_line": 6975, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo [bar](/url)**\n", "html": "foo bar
\n", "example": 421, - "start_line": 6964, - "end_line": 6968, + "start_line": 6984, + "end_line": 6988, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo\nbar**\n", "html": "foo\nbar
\n", "example": 422, - "start_line": 6971, - "end_line": 6977, + "start_line": 6991, + "end_line": 6997, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo _bar_ baz__\n", "html": "foo bar baz
\n", "example": 423, - "start_line": 6983, - "end_line": 6987, + "start_line": 7003, + "end_line": 7007, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo __bar__ baz__\n", "html": "foo bar baz
\n", "example": 424, - "start_line": 6990, - "end_line": 6994, + "start_line": 7010, + "end_line": 7014, "section": "Emphasis and strong emphasis" }, { "markdown": "____foo__ bar__\n", "html": "foo bar
\n", "example": 425, - "start_line": 6997, - "end_line": 7001, + "start_line": 7017, + "end_line": 7021, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo **bar****\n", "html": "foo bar
\n", "example": 426, - "start_line": 7004, - "end_line": 7008, + "start_line": 7024, + "end_line": 7028, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo *bar* baz**\n", "html": "foo bar baz
\n", "example": 427, - "start_line": 7011, - "end_line": 7015, + "start_line": 7031, + "end_line": 7035, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo*bar*baz**\n", "html": "foobarbaz
\n", "example": 428, - "start_line": 7018, - "end_line": 7022, + "start_line": 7038, + "end_line": 7042, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo* bar**\n", "html": "foo bar
\n", "example": 429, - "start_line": 7025, - "end_line": 7029, + "start_line": 7045, + "end_line": 7049, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo *bar***\n", "html": "foo bar
\n", "example": 430, - "start_line": 7032, - "end_line": 7036, + "start_line": 7052, + "end_line": 7056, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo *bar **baz**\nbim* bop**\n", "html": "foo bar baz\nbim bop
\n", "example": 431, - "start_line": 7041, - "end_line": 7047, + "start_line": 7061, + "end_line": 7067, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo [*bar*](/url)**\n", "html": "foo bar
\n", "example": 432, - "start_line": 7050, - "end_line": 7054, + "start_line": 7070, + "end_line": 7074, "section": "Emphasis and strong emphasis" }, { "markdown": "__ is not an empty emphasis\n", "html": "__ is not an empty emphasis
\n", "example": 433, - "start_line": 7059, - "end_line": 7063, + "start_line": 7079, + "end_line": 7083, "section": "Emphasis and strong emphasis" }, { "markdown": "____ is not an empty strong emphasis\n", "html": "____ is not an empty strong emphasis
\n", "example": 434, - "start_line": 7066, - "end_line": 7070, + "start_line": 7086, + "end_line": 7090, "section": "Emphasis and strong emphasis" }, { "markdown": "foo ***\n", "html": "foo ***
\n", "example": 435, - "start_line": 7076, - "end_line": 7080, + "start_line": 7096, + "end_line": 7100, "section": "Emphasis and strong emphasis" }, { "markdown": "foo *\\**\n", "html": "foo *
\n", "example": 436, - "start_line": 7083, - "end_line": 7087, + "start_line": 7103, + "end_line": 7107, "section": "Emphasis and strong emphasis" }, { "markdown": "foo *_*\n", "html": "foo _
\n", "example": 437, - "start_line": 7090, - "end_line": 7094, + "start_line": 7110, + "end_line": 7114, "section": "Emphasis and strong emphasis" }, { "markdown": "foo *****\n", "html": "foo *****
\n", "example": 438, - "start_line": 7097, - "end_line": 7101, + "start_line": 7117, + "end_line": 7121, "section": "Emphasis and strong emphasis" }, { "markdown": "foo **\\***\n", "html": "foo *
\n", "example": 439, - "start_line": 7104, - "end_line": 7108, + "start_line": 7124, + "end_line": 7128, "section": "Emphasis and strong emphasis" }, { "markdown": "foo **_**\n", "html": "foo _
\n", "example": 440, - "start_line": 7111, - "end_line": 7115, + "start_line": 7131, + "end_line": 7135, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo*\n", "html": "*foo
\n", "example": 441, - "start_line": 7122, - "end_line": 7126, + "start_line": 7142, + "end_line": 7146, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**\n", "html": "foo*
\n", "example": 442, - "start_line": 7129, - "end_line": 7133, + "start_line": 7149, + "end_line": 7153, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo**\n", "html": "*foo
\n", "example": 443, - "start_line": 7136, - "end_line": 7140, + "start_line": 7156, + "end_line": 7160, "section": "Emphasis and strong emphasis" }, { "markdown": "****foo*\n", "html": "***foo
\n", "example": 444, - "start_line": 7143, - "end_line": 7147, + "start_line": 7163, + "end_line": 7167, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo***\n", "html": "foo*
\n", "example": 445, - "start_line": 7150, - "end_line": 7154, + "start_line": 7170, + "end_line": 7174, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo****\n", "html": "foo***
\n", "example": 446, - "start_line": 7157, - "end_line": 7161, + "start_line": 7177, + "end_line": 7181, "section": "Emphasis and strong emphasis" }, { "markdown": "foo ___\n", "html": "foo ___
\n", "example": 447, - "start_line": 7167, - "end_line": 7171, + "start_line": 7187, + "end_line": 7191, "section": "Emphasis and strong emphasis" }, { "markdown": "foo _\\__\n", "html": "foo _
\n", "example": 448, - "start_line": 7174, - "end_line": 7178, + "start_line": 7194, + "end_line": 7198, "section": "Emphasis and strong emphasis" }, { "markdown": "foo _*_\n", "html": "foo *
\n", "example": 449, - "start_line": 7181, - "end_line": 7185, + "start_line": 7201, + "end_line": 7205, "section": "Emphasis and strong emphasis" }, { "markdown": "foo _____\n", "html": "foo _____
\n", "example": 450, - "start_line": 7188, - "end_line": 7192, + "start_line": 7208, + "end_line": 7212, "section": "Emphasis and strong emphasis" }, { "markdown": "foo __\\___\n", "html": "foo _
\n", "example": 451, - "start_line": 7195, - "end_line": 7199, + "start_line": 7215, + "end_line": 7219, "section": "Emphasis and strong emphasis" }, { "markdown": "foo __*__\n", "html": "foo *
\n", "example": 452, - "start_line": 7202, - "end_line": 7206, + "start_line": 7222, + "end_line": 7226, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo_\n", "html": "_foo
\n", "example": 453, - "start_line": 7209, - "end_line": 7213, + "start_line": 7229, + "end_line": 7233, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo__\n", "html": "foo_
\n", "example": 454, - "start_line": 7220, - "end_line": 7224, + "start_line": 7240, + "end_line": 7244, "section": "Emphasis and strong emphasis" }, { "markdown": "___foo__\n", "html": "_foo
\n", "example": 455, - "start_line": 7227, - "end_line": 7231, + "start_line": 7247, + "end_line": 7251, "section": "Emphasis and strong emphasis" }, { "markdown": "____foo_\n", "html": "___foo
\n", "example": 456, - "start_line": 7234, - "end_line": 7238, + "start_line": 7254, + "end_line": 7258, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo___\n", "html": "foo_
\n", "example": 457, - "start_line": 7241, - "end_line": 7245, + "start_line": 7261, + "end_line": 7265, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo____\n", "html": "foo___
\n", "example": 458, - "start_line": 7248, - "end_line": 7252, + "start_line": 7268, + "end_line": 7272, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo**\n", "html": "foo
\n", "example": 459, - "start_line": 7258, - "end_line": 7262, + "start_line": 7278, + "end_line": 7282, "section": "Emphasis and strong emphasis" }, { "markdown": "*_foo_*\n", "html": "foo
\n", "example": 460, - "start_line": 7265, - "end_line": 7269, + "start_line": 7285, + "end_line": 7289, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__\n", "html": "foo
\n", "example": 461, - "start_line": 7272, - "end_line": 7276, + "start_line": 7292, + "end_line": 7296, "section": "Emphasis and strong emphasis" }, { "markdown": "_*foo*_\n", "html": "foo
\n", "example": 462, - "start_line": 7279, - "end_line": 7283, + "start_line": 7299, + "end_line": 7303, "section": "Emphasis and strong emphasis" }, { "markdown": "****foo****\n", "html": "foo
\n", "example": 463, - "start_line": 7289, - "end_line": 7293, + "start_line": 7309, + "end_line": 7313, "section": "Emphasis and strong emphasis" }, { "markdown": "____foo____\n", "html": "foo
\n", "example": 464, - "start_line": 7296, - "end_line": 7300, + "start_line": 7316, + "end_line": 7320, "section": "Emphasis and strong emphasis" }, { "markdown": "******foo******\n", "html": "foo
\n", "example": 465, - "start_line": 7307, - "end_line": 7311, + "start_line": 7327, + "end_line": 7331, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo***\n", "html": "foo
\n", "example": 466, - "start_line": 7316, - "end_line": 7320, + "start_line": 7336, + "end_line": 7340, "section": "Emphasis and strong emphasis" }, { "markdown": "_____foo_____\n", "html": "foo
\n", "example": 467, - "start_line": 7323, - "end_line": 7327, + "start_line": 7343, + "end_line": 7347, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo _bar* baz_\n", "html": "foo _bar baz_
\n", "example": 468, - "start_line": 7332, - "end_line": 7336, + "start_line": 7352, + "end_line": 7356, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo __bar *baz bim__ bam*\n", "html": "foo bar *baz bim bam
\n", "example": 469, - "start_line": 7339, - "end_line": 7343, + "start_line": 7359, + "end_line": 7363, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo **bar baz**\n", "html": "**foo bar baz
\n", "example": 470, - "start_line": 7348, - "end_line": 7352, + "start_line": 7368, + "end_line": 7372, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo *bar baz*\n", "html": "*foo bar baz
\n", "example": 471, - "start_line": 7355, - "end_line": 7359, + "start_line": 7375, + "end_line": 7379, "section": "Emphasis and strong emphasis" }, { "markdown": "*[bar*](/url)\n", "html": "*bar*
\n", "example": 472, - "start_line": 7364, - "end_line": 7368, + "start_line": 7384, + "end_line": 7388, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo [bar_](/url)\n", "html": "_foo bar_
\n", "example": 473, - "start_line": 7371, - "end_line": 7375, + "start_line": 7391, + "end_line": 7395, "section": "Emphasis and strong emphasis" }, { "markdown": "**
a *
a _
[link](/my uri)
\n", - "example": 485, - "start_line": 7537, - "end_line": 7541, + "example": 487, + "start_line": 7574, + "end_line": 7578, "section": "Links" }, { "markdown": "[link]([link](foo\nbar)
\n", - "example": 487, - "start_line": 7552, - "end_line": 7558, + "example": 489, + "start_line": 7589, + "end_line": 7595, "section": "Links" }, { "markdown": "[link]([link](
[link](<foo>)
\n", - "example": 490, - "start_line": 7579, - "end_line": 7583, + "example": 492, + "start_line": 7616, + "end_line": 7620, "section": "Links" }, { "markdown": "[a](\n[a](c)\n", "html": "[a](<b)c\n[a](<b)c>\n[a](c)
\n", - "example": 491, - "start_line": 7588, - "end_line": 7596, + "example": 493, + "start_line": 7625, + "end_line": 7633, "section": "Links" }, { "markdown": "[link](\\(foo\\))\n", "html": "\n", - "example": 492, - "start_line": 7600, - "end_line": 7604, + "example": 494, + "start_line": 7637, + "end_line": 7641, "section": "Links" }, { "markdown": "[link](foo(and(bar)))\n", "html": "\n", - "example": 493, - "start_line": 7609, - "end_line": 7613, + "example": 495, + "start_line": 7646, + "end_line": 7650, "section": "Links" }, + { + "markdown": "[link](foo(and(bar))\n", + "html": "[link](foo(and(bar))
\n", + "example": 496, + "start_line": 7655, + "end_line": 7659, + "section": "Links", + "shouldFail": true + }, { "markdown": "[link](foo\\(and\\(bar\\))\n", "html": "\n", - "example": 494, - "start_line": 7618, - "end_line": 7622, + "example": 497, + "start_line": 7662, + "end_line": 7666, "section": "Links" }, { "markdown": "[link]([link](/url "title "and" title")
\n", - "example": 504, - "start_line": 7729, - "end_line": 7733, + "example": 507, + "start_line": 7774, + "end_line": 7778, "section": "Links" }, { "markdown": "[link](/url 'title \"and\" title')\n", "html": "\n", - "example": 505, - "start_line": 7738, - "end_line": 7742, + "example": 508, + "start_line": 7783, + "end_line": 7787, "section": "Links" }, { "markdown": "[link]( /uri\n \"title\" )\n", "html": "\n", - "example": 506, - "start_line": 7762, - "end_line": 7767, + "example": 509, + "start_line": 7808, + "end_line": 7813, "section": "Links" }, { "markdown": "[link] (/uri)\n", "html": "[link] (/uri)
\n", - "example": 507, - "start_line": 7773, - "end_line": 7777, + "example": 510, + "start_line": 7819, + "end_line": 7823, "section": "Links" }, { "markdown": "[link [foo [bar]]](/uri)\n", "html": "\n", - "example": 508, - "start_line": 7783, - "end_line": 7787, + "example": 511, + "start_line": 7829, + "end_line": 7833, "section": "Links", "shouldFail": true }, { "markdown": "[link] bar](/uri)\n", "html": "[link] bar](/uri)
\n", - "example": 509, - "start_line": 7790, - "end_line": 7794, + "example": 512, + "start_line": 7836, + "end_line": 7840, "section": "Links" }, { "markdown": "[link [bar](/uri)\n", "html": "[link bar
\n", - "example": 510, - "start_line": 7797, - "end_line": 7801, + "example": 513, + "start_line": 7843, + "end_line": 7847, "section": "Links" }, { "markdown": "[link \\[bar](/uri)\n", "html": "\n", - "example": 511, - "start_line": 7804, - "end_line": 7808, + "example": 514, + "start_line": 7850, + "end_line": 7854, "section": "Links" }, { "markdown": "[link *foo **bar** `#`*](/uri)\n", "html": "\n", - "example": 512, - "start_line": 7813, - "end_line": 7817, + "example": 515, + "start_line": 7859, + "end_line": 7863, "section": "Links" }, { "markdown": "[](/uri)\n", "html": "\n", - "example": 513, - "start_line": 7820, - "end_line": 7824, + "example": 516, + "start_line": 7866, + "end_line": 7870, "section": "Links" }, { "markdown": "[foo [bar](/uri)](/uri)\n", "html": "[foo bar](/uri)
\n", - "example": 514, - "start_line": 7829, - "end_line": 7833, + "example": 517, + "start_line": 7875, + "end_line": 7879, "section": "Links", "shouldFail": true }, { "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", "html": "[foo [bar baz](/uri)](/uri)
\n", - "example": 515, - "start_line": 7836, - "end_line": 7840, + "example": 518, + "start_line": 7882, + "end_line": 7886, "section": "Links", "shouldFail": true }, { "markdown": "](uri2)](uri3)\n", "html": "*foo*
\n", - "example": 517, - "start_line": 7853, - "end_line": 7857, + "example": 520, + "start_line": 7899, + "end_line": 7903, "section": "Links" }, { "markdown": "[foo *bar](baz*)\n", "html": "\n", - "example": 518, - "start_line": 7860, - "end_line": 7864, + "example": 521, + "start_line": 7906, + "end_line": 7910, "section": "Links" }, { "markdown": "*foo [bar* baz]\n", "html": "foo [bar baz]
\n", - "example": 519, - "start_line": 7870, - "end_line": 7874, + "example": 522, + "start_line": 7916, + "end_line": 7920, "section": "Links" }, { "markdown": "[foo[foo
[foo](/uri)
[foohttp://example.com/?search=](uri)
\n", - "example": 522, - "start_line": 7894, - "end_line": 7898, + "example": 525, + "start_line": 7940, + "end_line": 7944, "section": "Links", "shouldFail": true }, { "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", "html": "\n", - "example": 523, - "start_line": 7932, - "end_line": 7938, + "example": 526, + "start_line": 7978, + "end_line": 7984, "section": "Links" }, { "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 524, - "start_line": 7947, - "end_line": 7953, + "example": 527, + "start_line": 7993, + "end_line": 7999, "section": "Links", "shouldFail": true }, { "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 525, - "start_line": 7956, - "end_line": 7962, + "example": 528, + "start_line": 8002, + "end_line": 8008, "section": "Links" }, { "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 526, - "start_line": 7967, - "end_line": 7973, + "example": 529, + "start_line": 8013, + "end_line": 8019, "section": "Links" }, { "markdown": "[][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 527, - "start_line": 7976, - "end_line": 7982, + "example": 530, + "start_line": 8022, + "end_line": 8028, "section": "Links" }, { "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 528, - "start_line": 7987, - "end_line": 7993, + "example": 531, + "start_line": 8033, + "end_line": 8039, "section": "Links", "shouldFail": true }, { "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 529, - "start_line": 7996, - "end_line": 8002, + "example": 532, + "start_line": 8042, + "end_line": 8048, "section": "Links", "shouldFail": true }, { "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", "html": "*foo*
\n", - "example": 530, - "start_line": 8011, - "end_line": 8017, + "example": 533, + "start_line": 8057, + "end_line": 8063, "section": "Links" }, { - "markdown": "[foo *bar][ref]\n\n[ref]: /uri\n", - "html": "\n", - "example": 531, - "start_line": 8020, - "end_line": 8026, + "markdown": "[foo *bar][ref]*\n\n[ref]: /uri\n", + "html": "\n", + "example": 534, + "start_line": 8066, + "end_line": 8072, "section": "Links" }, { "markdown": "[foo[foo
[foo][ref]
[foohttp://example.com/?search=][ref]
\n", - "example": 534, - "start_line": 8050, - "end_line": 8056, + "example": 537, + "start_line": 8096, + "end_line": 8102, "section": "Links", "shouldFail": true }, { "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", "html": "\n", - "example": 535, - "start_line": 8061, - "end_line": 8067, + "example": 538, + "start_line": 8107, + "end_line": 8113, "section": "Links" }, { - "markdown": "[Толпой][Толпой] is a Russian word.\n\n[ТОЛПОЙ]: /url\n", - "html": "Толпой is a Russian word.
\n", - "example": 536, - "start_line": 8072, - "end_line": 8078, - "section": "Links" + "markdown": "[ẞ]\n\n[SS]: /url\n", + "html": "\n", + "example": 539, + "start_line": 8118, + "end_line": 8124, + "section": "Links", + "shouldFail": true }, { "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", "html": "\n", - "example": 537, - "start_line": 8084, - "end_line": 8091, + "example": 540, + "start_line": 8130, + "end_line": 8137, "section": "Links" }, { "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", "html": "[foo] bar
\n", - "example": 538, - "start_line": 8097, - "end_line": 8103, + "example": 541, + "start_line": 8143, + "end_line": 8149, "section": "Links" }, { "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", "html": "[foo]\nbar
\n", - "example": 539, - "start_line": 8106, - "end_line": 8114, + "example": 542, + "start_line": 8152, + "end_line": 8160, "section": "Links" }, { "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", "html": "\n", - "example": 540, - "start_line": 8147, - "end_line": 8155, + "example": 543, + "start_line": 8193, + "end_line": 8201, "section": "Links" }, { "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", "html": "[bar][foo!]
\n", - "example": 541, - "start_line": 8162, - "end_line": 8168, + "example": 544, + "start_line": 8208, + "end_line": 8214, "section": "Links" }, { "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", "html": "[foo][ref[]
\n[ref[]: /uri
\n", - "example": 542, - "start_line": 8174, - "end_line": 8181, + "example": 545, + "start_line": 8220, + "end_line": 8227, "section": "Links" }, { "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", "html": "[foo][ref[bar]]
\n[ref[bar]]: /uri
\n", - "example": 543, - "start_line": 8184, - "end_line": 8191, + "example": 546, + "start_line": 8230, + "end_line": 8237, "section": "Links" }, { "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", "html": "[[[foo]]]
\n[[[foo]]]: /url
\n", - "example": 544, - "start_line": 8194, - "end_line": 8201, + "example": 547, + "start_line": 8240, + "end_line": 8247, "section": "Links" }, { "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", "html": "\n", - "example": 545, - "start_line": 8204, - "end_line": 8210, + "example": 548, + "start_line": 8250, + "end_line": 8256, "section": "Links" }, { "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", "html": "\n", - "example": 546, - "start_line": 8215, - "end_line": 8221, + "example": 549, + "start_line": 8261, + "end_line": 8267, "section": "Links" }, { "markdown": "[]\n\n[]: /uri\n", "html": "[]
\n[]: /uri
\n", - "example": 547, - "start_line": 8226, - "end_line": 8233, + "example": 550, + "start_line": 8273, + "end_line": 8280, "section": "Links" }, { "markdown": "[\n ]\n\n[\n ]: /uri\n", "html": "[\n]
\n[\n]: /uri
\n", - "example": 548, - "start_line": 8236, - "end_line": 8247, + "example": 551, + "start_line": 8283, + "end_line": 8294, "section": "Links" }, { "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 549, - "start_line": 8259, - "end_line": 8265, + "example": 552, + "start_line": 8306, + "end_line": 8312, "section": "Links" }, { "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", "html": "\n", - "example": 550, - "start_line": 8268, - "end_line": 8274, + "example": 553, + "start_line": 8315, + "end_line": 8321, "section": "Links" }, { "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 551, - "start_line": 8279, - "end_line": 8285, + "example": 554, + "start_line": 8326, + "end_line": 8332, "section": "Links" }, { "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", "html": "foo\n[]
\n", - "example": 552, - "start_line": 8292, - "end_line": 8300, + "example": 555, + "start_line": 8339, + "end_line": 8347, "section": "Links" }, { "markdown": "[foo]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 553, - "start_line": 8312, - "end_line": 8318, + "example": 556, + "start_line": 8359, + "end_line": 8365, "section": "Links" }, { "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", "html": "\n", - "example": 554, - "start_line": 8321, - "end_line": 8327, + "example": 557, + "start_line": 8368, + "end_line": 8374, "section": "Links" }, { "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", "html": "[foo bar]
\n", - "example": 555, - "start_line": 8330, - "end_line": 8336, + "example": 558, + "start_line": 8377, + "end_line": 8383, "section": "Links" }, { "markdown": "[[bar [foo]\n\n[foo]: /url\n", "html": "[[bar foo
\n", - "example": 556, - "start_line": 8339, - "end_line": 8345, + "example": 559, + "start_line": 8386, + "end_line": 8392, "section": "Links" }, { "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 557, - "start_line": 8350, - "end_line": 8356, + "example": 560, + "start_line": 8397, + "end_line": 8403, "section": "Links" }, { "markdown": "[foo] bar\n\n[foo]: /url\n", "html": "foo bar
\n", - "example": 558, - "start_line": 8361, - "end_line": 8367, + "example": 561, + "start_line": 8408, + "end_line": 8414, "section": "Links" }, { "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", "html": "[foo]
\n", - "example": 559, - "start_line": 8373, - "end_line": 8379, + "example": 562, + "start_line": 8420, + "end_line": 8426, "section": "Links" }, { "markdown": "[foo*]: /url\n\n*[foo*]\n", "html": "*foo*
\n", - "example": 560, - "start_line": 8385, - "end_line": 8391, + "example": 563, + "start_line": 8432, + "end_line": 8438, "section": "Links" }, { "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", "html": "\n", - "example": 561, - "start_line": 8397, - "end_line": 8404, + "example": 564, + "start_line": 8444, + "end_line": 8451, "section": "Links" }, { "markdown": "[foo][]\n\n[foo]: /url1\n", "html": "\n", - "example": 562, - "start_line": 8406, - "end_line": 8412, + "example": 565, + "start_line": 8453, + "end_line": 8459, "section": "Links" }, { "markdown": "[foo]()\n\n[foo]: /url1\n", "html": "\n", - "example": 563, - "start_line": 8416, - "end_line": 8422, + "example": 566, + "start_line": 8463, + "end_line": 8469, "section": "Links" }, { "markdown": "[foo](not a link)\n\n[foo]: /url1\n", "html": "foo(not a link)
\n", - "example": 564, - "start_line": 8424, - "end_line": 8430, + "example": 567, + "start_line": 8471, + "end_line": 8477, "section": "Links" }, { "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", "html": "[foo]bar
\n", - "example": 565, - "start_line": 8435, - "end_line": 8441, + "example": 568, + "start_line": 8482, + "end_line": 8488, "section": "Links" }, { "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", "html": "\n", - "example": 566, - "start_line": 8447, - "end_line": 8454, + "example": 569, + "start_line": 8494, + "end_line": 8501, "section": "Links" }, { "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", "html": "[foo]bar
\n", - "example": 567, - "start_line": 8460, - "end_line": 8467, + "example": 570, + "start_line": 8507, + "end_line": 8514, "section": "Links" }, { "markdown": "\n", "html": "My
\n[]
![[foo]]
\n[[foo]]: /url "title"
\n", - "example": 586, - "start_line": 8653, - "end_line": 8660, + "example": 589, + "start_line": 8700, + "end_line": 8707, "section": "Images" }, { "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", "html": "![foo]
\n", - "example": 588, - "start_line": 8677, - "end_line": 8683, + "example": 591, + "start_line": 8724, + "end_line": 8730, "section": "Images" }, { "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", "html": "!foo
\n", - "example": 589, - "start_line": 8689, - "end_line": 8695, + "example": 592, + "start_line": 8736, + "end_line": 8742, "section": "Images" }, { "markdown": "http://foo.bar.baz/test?q=hello&id=22&boolean
\n", - "example": 591, - "start_line": 8729, - "end_line": 8733, + "example": 594, + "start_line": 8776, + "end_line": 8780, "section": "Autolinks" }, { "markdown": "<http://foo.bar/baz bim>
\n", - "example": 598, - "start_line": 8787, - "end_line": 8791, + "example": 601, + "start_line": 8834, + "end_line": 8838, "section": "Autolinks" }, { "markdown": "<foo+@bar.example.com>
\n", - "example": 602, - "start_line": 8834, - "end_line": 8838, + "example": 605, + "start_line": 8881, + "end_line": 8885, "section": "Autolinks" }, { "markdown": "<>\n", "html": "<>
\n", - "example": 603, - "start_line": 8843, - "end_line": 8847, + "example": 606, + "start_line": 8890, + "end_line": 8894, "section": "Autolinks" }, { "markdown": "< http://foo.bar >\n", "html": "< http://foo.bar >
\n", - "example": 604, - "start_line": 8850, - "end_line": 8854, + "example": 607, + "start_line": 8897, + "end_line": 8901, "section": "Autolinks" }, { "markdown": "<m:abc>
\n", - "example": 605, - "start_line": 8857, - "end_line": 8861, + "example": 608, + "start_line": 8904, + "end_line": 8908, "section": "Autolinks" }, { "markdown": "<foo.bar.baz>
\n", - "example": 606, - "start_line": 8864, - "end_line": 8868, + "example": 609, + "start_line": 8911, + "end_line": 8915, "section": "Autolinks" }, { "markdown": "http://example.com\n", "html": "http://example.com
\n", - "example": 607, - "start_line": 8871, - "end_line": 8875, + "example": 610, + "start_line": 8918, + "end_line": 8922, "section": "Autolinks" }, { "markdown": "foo@bar.example.com\n", "html": "foo@bar.example.com
\n", - "example": 608, - "start_line": 8878, - "end_line": 8882, + "example": 611, + "start_line": 8925, + "end_line": 8929, "section": "Autolinks" }, { "markdown": "Foo
<33> <__>
\n", - "example": 614, - "start_line": 9009, - "end_line": 9013, + "example": 617, + "start_line": 9055, + "end_line": 9059, "section": "Raw HTML" }, { "markdown": "\n", "html": "<a h*#ref="hi">
\n", - "example": 615, - "start_line": 9018, - "end_line": 9022, + "example": 618, + "start_line": 9064, + "end_line": 9068, "section": "Raw HTML" }, { "markdown": " \n", "html": "<a href="hi'> <a href=hi'>
\n", - "example": 616, - "start_line": 9027, - "end_line": 9031, + "example": 619, + "start_line": 9073, + "end_line": 9077, "section": "Raw HTML" }, { "markdown": "< a><\nfoo>< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />
\n", - "example": 617, - "start_line": 9036, - "end_line": 9046, + "example": 620, + "start_line": 9082, + "end_line": 9092, "section": "Raw HTML" }, { "markdown": "\n", "html": "<a href='bar'title=title>
\n", - "example": 618, - "start_line": 9051, - "end_line": 9055, + "example": 621, + "start_line": 9097, + "end_line": 9101, "section": "Raw HTML" }, { "markdown": "</a href="foo">
\n", - "example": 620, - "start_line": 9069, - "end_line": 9073, + "example": 623, + "start_line": 9115, + "end_line": 9119, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "foo
\n", - "example": 621, - "start_line": 9078, - "end_line": 9084, + "example": 624, + "start_line": 9124, + "end_line": 9130, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "foo <!-- not a comment -- two hyphens -->
\n", - "example": 622, - "start_line": 9087, - "end_line": 9091, + "example": 625, + "start_line": 9133, + "end_line": 9137, "section": "Raw HTML", "shouldFail": true }, { "markdown": "foo foo -->\n\nfoo \n", "html": "foo <!--> foo -->
\nfoo <!-- foo--->
\n", - "example": 623, - "start_line": 9096, - "end_line": 9103, + "example": 626, + "start_line": 9142, + "end_line": 9149, "section": "Raw HTML", "shouldFail": true }, { "markdown": "foo \n", "html": "foo
\n", - "example": 624, - "start_line": 9108, - "end_line": 9112, + "example": 627, + "start_line": 9154, + "end_line": 9158, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "foo
\n", - "example": 625, - "start_line": 9117, - "end_line": 9121, + "example": 628, + "start_line": 9163, + "end_line": 9167, "section": "Raw HTML" }, { "markdown": "foo &<]]>\n", "html": "foo &<]]>
\n", - "example": 626, - "start_line": 9126, - "end_line": 9130, + "example": 629, + "start_line": 9172, + "end_line": 9176, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "\n", - "example": 627, - "start_line": 9136, - "end_line": 9140, + "example": 630, + "start_line": 9182, + "end_line": 9186, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "\n", - "example": 628, - "start_line": 9145, - "end_line": 9149, + "example": 631, + "start_line": 9191, + "end_line": 9195, "section": "Raw HTML" }, { "markdown": "\n", "html": "<a href=""">
\n", - "example": 629, - "start_line": 9152, - "end_line": 9156, + "example": 632, + "start_line": 9198, + "end_line": 9202, "section": "Raw HTML" }, { "markdown": "foo \nbaz\n", "html": "foo
\nbaz
foo
\nbaz
foo
\nbaz
foo
\nbar
foo
\nbar
foo
\nbar
foo
\nbar
code span
code span
code\\ span
foo\\
\n", - "example": 641, - "start_line": 9281, - "end_line": 9285, + "example": 644, + "start_line": 9327, + "end_line": 9331, "section": "Hard line breaks" }, { "markdown": "foo \n", "html": "foo
\n", - "example": 642, - "start_line": 9288, - "end_line": 9292, + "example": 645, + "start_line": 9334, + "end_line": 9338, "section": "Hard line breaks" }, { "markdown": "### foo\\\n", "html": "foo\nbaz
\n", - "example": 645, - "start_line": 9317, - "end_line": 9323, + "example": 648, + "start_line": 9363, + "end_line": 9369, "section": "Soft line breaks" }, { "markdown": "foo \n baz\n", "html": "foo\nbaz
\n", - "example": 646, - "start_line": 9329, - "end_line": 9335, + "example": 649, + "start_line": 9375, + "end_line": 9381, "section": "Soft line breaks" }, { "markdown": "hello $.;'there\n", "html": "hello $.;'there
\n", - "example": 647, - "start_line": 9349, - "end_line": 9353, + "example": 650, + "start_line": 9395, + "end_line": 9399, "section": "Textual content" }, { "markdown": "Foo χρῆν\n", "html": "Foo χρῆν
\n", - "example": 648, - "start_line": 9356, - "end_line": 9360, + "example": 651, + "start_line": 9402, + "end_line": 9406, "section": "Textual content" }, { "markdown": "Multiple spaces\n", "html": "Multiple spaces
\n", - "example": 649, - "start_line": 9365, - "end_line": 9369, + "example": 652, + "start_line": 9411, + "end_line": 9415, "section": "Textual content" } ] diff --git a/test/specs/gfm/commonmark.0.29.json b/test/specs/gfm/commonmark.0.30.json similarity index 79% rename from test/specs/gfm/commonmark.0.29.json rename to test/specs/gfm/commonmark.0.30.json index a412d89779..1b01311866 100644 --- a/test/specs/gfm/commonmark.0.29.json +++ b/test/specs/gfm/commonmark.0.30.json @@ -3,5244 +3,5270 @@ "markdown": "\tfoo\tbaz\t\tbim\n", "html": "foo\tbaz\t\tbim\n
\n",
"example": 1,
- "start_line": 352,
- "end_line": 357,
+ "start_line": 356,
+ "end_line": 361,
"section": "Tabs"
},
{
"markdown": " \tfoo\tbaz\t\tbim\n",
"html": "foo\tbaz\t\tbim\n
\n",
"example": 2,
- "start_line": 359,
- "end_line": 364,
+ "start_line": 363,
+ "end_line": 368,
"section": "Tabs"
},
{
"markdown": " a\ta\n ὐ\ta\n",
"html": "a\ta\nὐ\ta\n
\n",
"example": 3,
- "start_line": 366,
- "end_line": 373,
+ "start_line": 370,
+ "end_line": 377,
"section": "Tabs"
},
{
"markdown": " - foo\n\n\tbar\n",
"html": "foo
\nbar
\nfoo
\n bar\n
\n\n\n", "example": 6, - "start_line": 415, - "end_line": 422, + "start_line": 419, + "end_line": 426, "section": "Tabs" }, { "markdown": "-\t\tfoo\n", "html": "\nfoo\n
foo\n
\nfoo\nbar\n
\n",
"example": 8,
- "start_line": 436,
- "end_line": 443,
+ "start_line": 440,
+ "end_line": 447,
"section": "Tabs"
},
{
"markdown": " - foo\n - bar\n\t - baz\n",
"html": "!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~
\n", "example": 12, - "start_line": 496, + "start_line": 490, + "end_line": 494, + "section": "Backslash escapes" + }, + { + "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", + "html": "\\\t\\A\\a\\ \\3\\φ\\«
\n", + "example": 13, + "start_line": 500, "end_line": 504, + "section": "Backslash escapes" + }, + { + "markdown": "\\*not emphasized*\n\\*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\nö not a character entity
\n", + "example": 14, + "start_line": 510, + "end_line": 530, + "section": "Backslash escapes" + }, + { + "markdown": "\\\\*emphasis*\n", + "html": "\\emphasis
\n", + "example": 15, + "start_line": 535, + "end_line": 539, + "section": "Backslash escapes" + }, + { + "markdown": "foo\\\nbar\n", + "html": "foo
\nbar
\\[\\`
\\[\\]\n
\n",
+ "example": 18,
+ "start_line": 563,
+ "end_line": 568,
+ "section": "Backslash escapes"
+ },
+ {
+ "markdown": "~~~\n\\[\\]\n~~~\n",
+ "html": "\\[\\]\n
\n",
+ "example": 19,
+ "start_line": 571,
+ "end_line": 578,
+ "section": "Backslash escapes"
+ },
+ {
+ "markdown": "foo\n
\n",
+ "example": 24,
+ "start_line": 614,
+ "end_line": 621,
+ "section": "Backslash escapes",
+ "shouldFail": true
+ },
+ {
+ "markdown": " & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n",
+ "html": "& © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸
\n", + "example": 25, + "start_line": 650, + "end_line": 658, + "section": "Entity and numeric character references" + }, + { + "markdown": "# Ӓ Ϡ \n", + "html": "# Ӓ Ϡ �
\n", + "example": 26, + "start_line": 669, + "end_line": 673, + "section": "Entity and numeric character references" + }, + { + "markdown": "" ആ ಫ\n", + "html": "" ആ ಫ
\n", + "example": 27, + "start_line": 682, + "end_line": 686, + "section": "Entity and numeric character references" + }, + { + "markdown": "  &x; \n\nabcdef0;\n&ThisIsNotDefined; &hi?;\n", + "html": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;
\n", + "example": 28, + "start_line": 691, + "end_line": 701, + "section": "Entity and numeric character references", + "shouldFail": true + }, + { + "markdown": "©\n", + "html": "©
\n", + "example": 29, + "start_line": 708, + "end_line": 712, + "section": "Entity and numeric character references" + }, + { + "markdown": "&MadeUpEntity;\n", + "html": "&MadeUpEntity;
\n", + "example": 30, + "start_line": 718, + "end_line": 722, + "section": "Entity and numeric character references" + }, + { + "markdown": "\n", + "html": "\n", + "example": 31, + "start_line": 729, + "end_line": 733, + "section": "Entity and numeric character references" + }, + { + "markdown": "[foo](/föö \"föö\")\n", + "html": "\n", + "example": 32, + "start_line": 736, + "end_line": 740, + "section": "Entity and numeric character references", + "shouldFail": true + }, + { + "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", + "html": "\n", + "example": 33, + "start_line": 743, + "end_line": 749, + "section": "Entity and numeric character references", + "shouldFail": true + }, + { + "markdown": "``` föö\nfoo\n```\n", + "html": "foo\n
\n",
+ "example": 34,
+ "start_line": 752,
+ "end_line": 759,
+ "section": "Entity and numeric character references",
+ "shouldFail": true
+ },
+ {
+ "markdown": "`föö`\n",
+ "html": "föö
föfö\n
\n",
+ "example": 36,
+ "start_line": 772,
+ "end_line": 777,
+ "section": "Entity and numeric character references"
+ },
+ {
+ "markdown": "*foo*\n*foo*\n",
+ "html": "*foo*\nfoo
\n", + "example": 37, + "start_line": 784, + "end_line": 790, + "section": "Entity and numeric character references" + }, + { + "markdown": "* foo\n\n* foo\n", + "html": "* foo
\nfoo\n\nbar
\n", + "example": 39, + "start_line": 803, + "end_line": 809, + "section": "Entity and numeric character references" + }, + { + "markdown": " foo\n", + "html": "\tfoo
\n", + "example": 40, + "start_line": 811, + "end_line": 815, + "section": "Entity and numeric character references" + }, + { + "markdown": "[a](url "tit")\n", + "html": "[a](url "tit")
\n", + "example": 41, + "start_line": 818, + "end_line": 822, + "section": "Entity and numeric character references" + }, + { + "markdown": "- `one\n- two`\n", + "html": "+++
\n", - "example": 14, - "start_line": 548, - "end_line": 552, + "example": 44, + "start_line": 893, + "end_line": 897, "section": "Thematic breaks" }, { "markdown": "===\n", "html": "===
\n", - "example": 15, - "start_line": 555, - "end_line": 559, + "example": 45, + "start_line": 900, + "end_line": 904, "section": "Thematic breaks" }, { "markdown": "--\n**\n__\n", "html": "--\n**\n__
\n", - "example": 16, - "start_line": 564, - "end_line": 572, + "example": 46, + "start_line": 909, + "end_line": 917, "section": "Thematic breaks" }, { "markdown": " ***\n ***\n ***\n", "html": "***\n
\n",
- "example": 18,
- "start_line": 590,
- "end_line": 595,
+ "example": 48,
+ "start_line": 935,
+ "end_line": 940,
"section": "Thematic breaks"
},
{
"markdown": "Foo\n ***\n",
"html": "Foo\n***
\n", - "example": 19, - "start_line": 598, - "end_line": 604, + "example": 49, + "start_line": 943, + "end_line": 949, "section": "Thematic breaks" }, { "markdown": "_____________________________________\n", "html": "_ _ _ _ a
\na------
\n---a---
\n", - "example": 25, - "start_line": 650, - "end_line": 660, + "example": 55, + "start_line": 995, + "end_line": 1005, "section": "Thematic breaks" }, { "markdown": " *-*\n", "html": "-
\n", - "example": 26, - "start_line": 666, - "end_line": 670, + "example": 56, + "start_line": 1011, + "end_line": 1015, "section": "Thematic breaks" }, { "markdown": "- foo\n***\n- bar\n", "html": "Foo
\nbar
\n", - "example": 28, - "start_line": 692, - "end_line": 700, + "example": 58, + "start_line": 1037, + "end_line": 1045, "section": "Thematic breaks" }, { "markdown": "Foo\n---\nbar\n", "html": "bar
\n", - "example": 29, - "start_line": 709, - "end_line": 716, + "example": 59, + "start_line": 1054, + "end_line": 1061, "section": "Thematic breaks" }, { "markdown": "* Foo\n* * *\n* Bar\n", "html": "####### foo
\n", - "example": 33, - "start_line": 787, - "end_line": 791, + "example": 63, + "start_line": 1132, + "end_line": 1136, "section": "ATX headings" }, { "markdown": "#5 bolt\n\n#hashtag\n", "html": "#5 bolt
\n#hashtag
\n", - "example": 34, - "start_line": 802, - "end_line": 809, + "example": 64, + "start_line": 1147, + "end_line": 1154, "section": "ATX headings" }, { "markdown": "\\## foo\n", "html": "## foo
\n", - "example": 35, - "start_line": 814, - "end_line": 818, + "example": 65, + "start_line": 1159, + "end_line": 1163, "section": "ATX headings" }, { "markdown": "# foo *bar* \\*baz\\*\n", "html": "# foo\n
\n",
- "example": 39,
- "start_line": 854,
- "end_line": 859,
+ "example": 69,
+ "start_line": 1199,
+ "end_line": 1204,
"section": "ATX headings"
},
{
"markdown": "foo\n # bar\n",
"html": "foo\n# bar
\n", - "example": 40, - "start_line": 862, - "end_line": 868, + "example": 70, + "start_line": 1207, + "end_line": 1213, "section": "ATX headings" }, { "markdown": "## foo ##\n ### bar ###\n", "html": "Foo bar
\nBar foo
\n", - "example": 48, - "start_line": 950, - "end_line": 958, + "example": 78, + "start_line": 1295, + "end_line": 1303, "section": "ATX headings" }, { "markdown": "## \n#\n### ###\n", "html": "\n\n\n", - "example": 49, - "start_line": 963, - "end_line": 971, + "example": 79, + "start_line": 1308, + "end_line": 1316, "section": "ATX headings" }, { "markdown": "Foo *bar*\n=========\n\nFoo *bar*\n---------\n", "html": "Foo\n---\n\nFoo\n
\nFoo\n---
\n", - "example": 57, - "start_line": 1108, - "end_line": 1114, + "example": 87, + "start_line": 1453, + "end_line": 1459, "section": "Setext headings" }, { "markdown": "Foo\n= =\n\nFoo\n--- -\n", "html": "Foo\n= =
\nFoo
\n`
\nof dashes"/>
\n", - "example": 61, - "start_line": 1156, - "end_line": 1169, + "example": 91, + "start_line": 1501, + "end_line": 1514, "section": "Setext headings" }, { "markdown": "> Foo\n---\n", "html": "\n\nFoo
\n
\n\n", - "example": 63, - "start_line": 1186, - "end_line": 1196, + "example": 93, + "start_line": 1531, + "end_line": 1541, "section": "Setext headings" }, { "markdown": "- Foo\n---\n", "html": "foo\nbar\n===
\n
Baz
\n", - "example": 66, - "start_line": 1227, - "end_line": 1239, + "example": 96, + "start_line": 1572, + "end_line": 1584, "section": "Setext headings" }, { "markdown": "\n====\n", "html": "====
\n", - "example": 67, - "start_line": 1244, - "end_line": 1249, + "example": 97, + "start_line": 1589, + "end_line": 1594, "section": "Setext headings" }, { "markdown": "---\n---\n", "html": "foo\n
\n\n\nfoo
\n
Foo
\nbaz
\n", - "example": 73, - "start_line": 1331, - "end_line": 1341, + "example": 103, + "start_line": 1676, + "end_line": 1686, "section": "Setext headings" }, { "markdown": "Foo\nbar\n\n---\n\nbaz\n", "html": "Foo\nbar
\nbaz
\n", - "example": 74, - "start_line": 1347, - "end_line": 1359, + "example": 104, + "start_line": 1692, + "end_line": 1704, "section": "Setext headings" }, { "markdown": "Foo\nbar\n* * *\nbaz\n", "html": "Foo\nbar
\nbaz
\n", - "example": 75, - "start_line": 1365, - "end_line": 1375, + "example": 105, + "start_line": 1710, + "end_line": 1720, "section": "Setext headings" }, { "markdown": "Foo\nbar\n\\---\nbaz\n", "html": "Foo\nbar\n---\nbaz
\n", - "example": 76, - "start_line": 1380, - "end_line": 1390, + "example": 106, + "start_line": 1725, + "end_line": 1735, "section": "Setext headings" }, { "markdown": " a simple\n indented code block\n", "html": "a simple\n indented code block\n
\n",
- "example": 77,
- "start_line": 1408,
- "end_line": 1415,
+ "example": 107,
+ "start_line": 1753,
+ "end_line": 1760,
"section": "Indented code blocks"
},
{
"markdown": " - foo\n\n bar\n",
"html": "foo
\nbar
\nfoo
\n<a/>\n*hi*\n\n- one\n
\n",
- "example": 80,
- "start_line": 1456,
- "end_line": 1467,
+ "example": 110,
+ "start_line": 1801,
+ "end_line": 1812,
"section": "Indented code blocks"
},
{
"markdown": " chunk1\n\n chunk2\n \n \n \n chunk3\n",
"html": "chunk1\n\nchunk2\n\n\n\nchunk3\n
\n",
- "example": 81,
- "start_line": 1472,
- "end_line": 1489,
+ "example": 111,
+ "start_line": 1817,
+ "end_line": 1834,
"section": "Indented code blocks"
},
{
"markdown": " chunk1\n \n chunk2\n",
"html": "chunk1\n \n chunk2\n
\n",
- "example": 82,
- "start_line": 1495,
- "end_line": 1504,
+ "example": 112,
+ "start_line": 1840,
+ "end_line": 1849,
"section": "Indented code blocks"
},
{
"markdown": "Foo\n bar\n\n",
"html": "Foo\nbar
\n", - "example": 83, - "start_line": 1510, - "end_line": 1517, + "example": 113, + "start_line": 1855, + "end_line": 1862, "section": "Indented code blocks" }, { "markdown": " foo\nbar\n", "html": "foo\n
\nbar
\n", - "example": 84, - "start_line": 1524, - "end_line": 1531, + "example": 114, + "start_line": 1869, + "end_line": 1876, "section": "Indented code blocks" }, { "markdown": "# Heading\n foo\nHeading\n------\n foo\n----\n", "html": "foo\n
\nfoo\n
\n foo\nbar\n
\n",
- "example": 86,
- "start_line": 1557,
- "end_line": 1564,
+ "example": 116,
+ "start_line": 1902,
+ "end_line": 1909,
"section": "Indented code blocks"
},
{
"markdown": "\n \n foo\n \n\n",
"html": "foo\n
\n",
- "example": 87,
- "start_line": 1570,
- "end_line": 1579,
+ "example": 117,
+ "start_line": 1915,
+ "end_line": 1924,
"section": "Indented code blocks"
},
{
"markdown": " foo \n",
"html": "foo \n
\n",
- "example": 88,
- "start_line": 1584,
- "end_line": 1589,
+ "example": 118,
+ "start_line": 1929,
+ "end_line": 1934,
"section": "Indented code blocks"
},
{
"markdown": "```\n<\n >\n```\n",
"html": "<\n >\n
\n",
- "example": 89,
- "start_line": 1639,
- "end_line": 1648,
+ "example": 119,
+ "start_line": 1984,
+ "end_line": 1993,
"section": "Fenced code blocks"
},
{
"markdown": "~~~\n<\n >\n~~~\n",
"html": "<\n >\n
\n",
- "example": 90,
- "start_line": 1653,
- "end_line": 1662,
+ "example": 120,
+ "start_line": 1998,
+ "end_line": 2007,
"section": "Fenced code blocks"
},
{
"markdown": "``\nfoo\n``\n",
"html": "foo
aaa\n~~~\n
\n",
- "example": 92,
- "start_line": 1677,
- "end_line": 1686,
+ "example": 122,
+ "start_line": 2022,
+ "end_line": 2031,
"section": "Fenced code blocks"
},
{
"markdown": "~~~\naaa\n```\n~~~\n",
"html": "aaa\n```\n
\n",
- "example": 93,
- "start_line": 1689,
- "end_line": 1698,
+ "example": 123,
+ "start_line": 2034,
+ "end_line": 2043,
"section": "Fenced code blocks"
},
{
"markdown": "````\naaa\n```\n``````\n",
"html": "aaa\n```\n
\n",
- "example": 94,
- "start_line": 1703,
- "end_line": 1712,
+ "example": 124,
+ "start_line": 2048,
+ "end_line": 2057,
"section": "Fenced code blocks"
},
{
"markdown": "~~~~\naaa\n~~~\n~~~~\n",
"html": "aaa\n~~~\n
\n",
- "example": 95,
- "start_line": 1715,
- "end_line": 1724,
+ "example": 125,
+ "start_line": 2060,
+ "end_line": 2069,
"section": "Fenced code blocks"
},
{
"markdown": "```\n",
"html": "
\n",
- "example": 96,
- "start_line": 1730,
- "end_line": 1734,
+ "example": 126,
+ "start_line": 2075,
+ "end_line": 2079,
"section": "Fenced code blocks"
},
{
"markdown": "`````\n\n```\naaa\n",
"html": "\n```\naaa\n
\n",
- "example": 97,
- "start_line": 1737,
- "end_line": 1747,
+ "example": 127,
+ "start_line": 2082,
+ "end_line": 2092,
"section": "Fenced code blocks"
},
{
"markdown": "> ```\n> aaa\n\nbbb\n",
"html": "\n\n\naaa\n
bbb
\n", - "example": 98, - "start_line": 1750, - "end_line": 1761, + "example": 128, + "start_line": 2095, + "end_line": 2106, "section": "Fenced code blocks" }, { "markdown": "```\n\n \n```\n", "html": "\n \n
\n",
- "example": 99,
- "start_line": 1766,
- "end_line": 1775,
+ "example": 129,
+ "start_line": 2111,
+ "end_line": 2120,
"section": "Fenced code blocks"
},
{
"markdown": "```\n```\n",
"html": "
\n",
- "example": 100,
- "start_line": 1780,
- "end_line": 1785,
+ "example": 130,
+ "start_line": 2125,
+ "end_line": 2130,
"section": "Fenced code blocks"
},
{
"markdown": " ```\n aaa\naaa\n```\n",
"html": "aaa\naaa\n
\n",
- "example": 101,
- "start_line": 1792,
- "end_line": 1801,
+ "example": 131,
+ "start_line": 2137,
+ "end_line": 2146,
"section": "Fenced code blocks"
},
{
"markdown": " ```\naaa\n aaa\naaa\n ```\n",
"html": "aaa\naaa\naaa\n
\n",
- "example": 102,
- "start_line": 1804,
- "end_line": 1815,
+ "example": 132,
+ "start_line": 2149,
+ "end_line": 2160,
"section": "Fenced code blocks"
},
{
"markdown": " ```\n aaa\n aaa\n aaa\n ```\n",
"html": "aaa\n aaa\naaa\n
\n",
- "example": 103,
- "start_line": 1818,
- "end_line": 1829,
+ "example": 133,
+ "start_line": 2163,
+ "end_line": 2174,
"section": "Fenced code blocks"
},
{
"markdown": " ```\n aaa\n ```\n",
"html": "```\naaa\n```\n
\n",
- "example": 104,
- "start_line": 1834,
- "end_line": 1843,
+ "example": 134,
+ "start_line": 2179,
+ "end_line": 2188,
"section": "Fenced code blocks"
},
{
"markdown": "```\naaa\n ```\n",
"html": "aaa\n
\n",
- "example": 105,
- "start_line": 1849,
- "end_line": 1856,
+ "example": 135,
+ "start_line": 2194,
+ "end_line": 2201,
"section": "Fenced code blocks"
},
{
"markdown": " ```\naaa\n ```\n",
"html": "aaa\n
\n",
- "example": 106,
- "start_line": 1859,
- "end_line": 1866,
+ "example": 136,
+ "start_line": 2204,
+ "end_line": 2211,
"section": "Fenced code blocks"
},
{
"markdown": "```\naaa\n ```\n",
"html": "aaa\n ```\n
\n",
- "example": 107,
- "start_line": 1871,
- "end_line": 1879,
+ "example": 137,
+ "start_line": 2216,
+ "end_line": 2224,
"section": "Fenced code blocks"
},
{
"markdown": "``` ```\naaa\n",
"html": "
\naaa
aaa\n~~~ ~~\n
\n",
- "example": 109,
- "start_line": 1894,
- "end_line": 1902,
+ "example": 139,
+ "start_line": 2239,
+ "end_line": 2247,
"section": "Fenced code blocks"
},
{
"markdown": "foo\n```\nbar\n```\nbaz\n",
"html": "foo
\nbar\n
\nbaz
\n", - "example": 110, - "start_line": 1908, - "end_line": 1919, + "example": 140, + "start_line": 2253, + "end_line": 2264, "section": "Fenced code blocks" }, { "markdown": "foo\n---\n~~~\nbar\n~~~\n# baz\n", "html": "bar\n
\ndef foo(x)\n return 3\nend\n
\n",
- "example": 112,
- "start_line": 1947,
- "end_line": 1958,
+ "example": 142,
+ "start_line": 2292,
+ "end_line": 2303,
"section": "Fenced code blocks"
},
{
"markdown": "~~~~ ruby startline=3 $%@#$\ndef foo(x)\n return 3\nend\n~~~~~~~\n",
"html": "def foo(x)\n return 3\nend\n
\n",
- "example": 113,
- "start_line": 1961,
- "end_line": 1972,
+ "example": 143,
+ "start_line": 2306,
+ "end_line": 2317,
"section": "Fenced code blocks"
},
{
"markdown": "````;\n````\n",
"html": "
\n",
- "example": 114,
- "start_line": 1975,
- "end_line": 1980,
+ "example": 144,
+ "start_line": 2320,
+ "end_line": 2325,
"section": "Fenced code blocks"
},
{
"markdown": "``` aa ```\nfoo\n",
"html": "aa
\nfoo
foo\n
\n",
- "example": 116,
- "start_line": 1996,
- "end_line": 2003,
+ "example": 146,
+ "start_line": 2341,
+ "end_line": 2348,
"section": "Fenced code blocks"
},
{
"markdown": "```\n``` aaa\n```\n",
"html": "``` aaa\n
\n",
- "example": 117,
- "start_line": 2008,
- "end_line": 2015,
+ "example": 147,
+ "start_line": 2353,
+ "end_line": 2360,
"section": "Fenced code blocks"
},
{
"markdown": "\n\n**Hello**,\n\n_world_.\n\n |
\n\n**Hello**,\n\n |
\n hi\n | \n
\n hi\n | \n
okay.
\n", - "example": 119, - "start_line": 2116, - "end_line": 2135, + "example": 149, + "start_line": 2461, + "end_line": 2480, "section": "HTML blocks" }, { "markdown": "Markdown
\nbar
\n", - "example": 125, - "start_line": 2201, - "end_line": 2210, + "example": 155, + "start_line": 2546, + "end_line": 2555, "section": "HTML blocks" }, { "markdown": "\n", "html": "\n", - "example": 129, - "start_line": 2250, - "end_line": 2254, + "example": 159, + "start_line": 2595, + "end_line": 2599, "section": "HTML blocks" }, { "markdown": "\nfoo\n |
\nfoo\n |
foo
\nfoo
\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay\n",
"html": "\nimport Text.HTML.TagSoup\n\nmain :: IO ()\nmain = print $ parseTags tags\n
\nokay
\n", - "example": 139, - "start_line": 2390, - "end_line": 2406, + "example": 169, + "start_line": 2735, + "end_line": 2751, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 140, - "start_line": 2411, - "end_line": 2425, + "example": 170, + "start_line": 2756, + "end_line": 2770, + "section": "HTML blocks" + }, + { + "markdown": "\n", + "html": "\n", + "example": 171, + "start_line": 2775, + "end_line": 2791, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 141, - "start_line": 2430, - "end_line": 2446, + "example": 172, + "start_line": 2795, + "end_line": 2811, "section": "HTML blocks" }, { "markdown": "\n*foo*\n", "html": "\nfoo
\n", - "example": 145, - "start_line": 2495, - "end_line": 2501, + "example": 176, + "start_line": 2860, + "end_line": 2866, "section": "HTML blocks" }, { "markdown": "*bar*\n*baz*\n", "html": "*bar*\nbaz
\n", - "example": 146, - "start_line": 2504, - "end_line": 2510, + "example": 177, + "start_line": 2869, + "end_line": 2875, "section": "HTML blocks" }, { "markdown": "1. *bar*\n", "html": "1. *bar*\n", - "example": 147, - "start_line": 2516, - "end_line": 2524, + "example": 178, + "start_line": 2881, + "end_line": 2889, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 148, - "start_line": 2529, - "end_line": 2541, + "example": 179, + "start_line": 2894, + "end_line": 2906, "section": "HTML blocks" }, { "markdown": "';\n\n?>\nokay\n", "html": "';\n\n?>\nokay
\n", - "example": 149, - "start_line": 2547, - "end_line": 2561, + "example": 180, + "start_line": 2912, + "end_line": 2926, "section": "HTML blocks" }, { "markdown": "\n", "html": "\n", - "example": 150, - "start_line": 2566, - "end_line": 2570, + "example": 181, + "start_line": 2931, + "end_line": 2935, "section": "HTML blocks" }, { "markdown": "\nokay\n", "html": "\nokay
\n", - "example": 151, - "start_line": 2575, - "end_line": 2603, + "example": 182, + "start_line": 2940, + "end_line": 2968, "section": "HTML blocks" }, { "markdown": " \n\n \n", "html": " \n<!-- foo -->\n
\n",
- "example": 152,
- "start_line": 2608,
- "end_line": 2616,
+ "example": 183,
+ "start_line": 2974,
+ "end_line": 2982,
"section": "HTML blocks"
},
{
"markdown": " <div>\n
\n",
- "example": 153,
- "start_line": 2619,
- "end_line": 2627,
+ "example": 184,
+ "start_line": 2985,
+ "end_line": 2993,
"section": "HTML blocks"
},
{
"markdown": "Foo\nFoo
\nFoo\n\nbaz
\n", - "example": 156, - "start_line": 2665, - "end_line": 2673, + "example": 187, + "start_line": 3031, + "end_line": 3039, "section": "HTML blocks" }, { "markdown": "Emphasized text.
\n\nHi\n | \n\n
\nHi\n | \n
\n Hi\n | \n\n
[foo]: /url 'title
\nwith blank line'
\n[foo]
\n", - "example": 166, - "start_line": 2877, - "end_line": 2887, + "example": 197, + "start_line": 3244, + "end_line": 3254, "section": "Link reference definitions" }, { "markdown": "[foo]:\n/url\n\n[foo]\n", "html": "\n", - "example": 167, - "start_line": 2892, - "end_line": 2899, + "example": 198, + "start_line": 3259, + "end_line": 3266, "section": "Link reference definitions" }, { "markdown": "[foo]:\n\n[foo]\n", "html": "[foo]:
\n[foo]
\n", - "example": 168, - "start_line": 2904, - "end_line": 2911, + "example": 199, + "start_line": 3271, + "end_line": 3278, "section": "Link reference definitions" }, { "markdown": "[foo]: <>\n\n[foo]\n", "html": "\n", - "example": 169, - "start_line": 2916, - "end_line": 2922, + "example": 200, + "start_line": 3283, + "end_line": 3289, "section": "Link reference definitions", "shouldFail": true }, { "markdown": "[foo]:[foo]:
[foo]
\n", - "example": 170, - "start_line": 2927, - "end_line": 2934, + "example": 201, + "start_line": 3294, + "end_line": 3301, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\\bar\\*baz \"foo\\\"bar\\baz\"\n\n[foo]\n", "html": "\n", - "example": 171, - "start_line": 2940, - "end_line": 2946, + "example": 202, + "start_line": 3307, + "end_line": 3313, "section": "Link reference definitions", "shouldFail": true }, { "markdown": "[foo]\n\n[foo]: url\n", "html": "\n", - "example": 172, - "start_line": 2951, - "end_line": 2957, + "example": 203, + "start_line": 3318, + "end_line": 3324, "section": "Link reference definitions" }, { "markdown": "[foo]\n\n[foo]: first\n[foo]: second\n", "html": "\n", - "example": 173, - "start_line": 2963, - "end_line": 2970, + "example": 204, + "start_line": 3330, + "end_line": 3337, "section": "Link reference definitions" }, { "markdown": "[FOO]: /url\n\n[Foo]\n", "html": "\n", - "example": 174, - "start_line": 2976, - "end_line": 2982, + "example": 205, + "start_line": 3343, + "end_line": 3349, "section": "Link reference definitions" }, { "markdown": "[ΑΓΩ]: /φου\n\n[αγω]\n", "html": "\n", - "example": 175, - "start_line": 2985, - "end_line": 2991, + "example": 206, + "start_line": 3352, + "end_line": 3358, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\n", "html": "", - "example": 176, - "start_line": 2997, - "end_line": 3000, + "example": 207, + "start_line": 3367, + "end_line": 3370, "section": "Link reference definitions" }, { "markdown": "[\nfoo\n]: /url\nbar\n", "html": "bar
\n", - "example": 177, - "start_line": 3005, - "end_line": 3012, + "example": 208, + "start_line": 3375, + "end_line": 3382, "section": "Link reference definitions" }, { "markdown": "[foo]: /url \"title\" ok\n", "html": "[foo]: /url "title" ok
\n", - "example": 178, - "start_line": 3018, - "end_line": 3022, + "example": 209, + "start_line": 3388, + "end_line": 3392, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\n\"title\" ok\n", "html": ""title" ok
\n", - "example": 179, - "start_line": 3027, - "end_line": 3032, + "example": 210, + "start_line": 3397, + "end_line": 3402, "section": "Link reference definitions" }, { "markdown": " [foo]: /url \"title\"\n\n[foo]\n", "html": "[foo]: /url "title"\n
\n[foo]
\n", - "example": 180, - "start_line": 3038, - "end_line": 3046, + "example": 211, + "start_line": 3408, + "end_line": 3416, "section": "Link reference definitions" }, { "markdown": "```\n[foo]: /url\n```\n\n[foo]\n", "html": "[foo]: /url\n
\n[foo]
\n", - "example": 181, - "start_line": 3052, - "end_line": 3062, + "example": 212, + "start_line": 3422, + "end_line": 3432, "section": "Link reference definitions" }, { "markdown": "Foo\n[bar]: /baz\n\n[bar]\n", "html": "Foo\n[bar]: /baz
\n[bar]
\n", - "example": 182, - "start_line": 3067, - "end_line": 3076, + "example": 213, + "start_line": 3437, + "end_line": 3446, "section": "Link reference definitions" }, { "markdown": "# [Foo]\n[foo]: /url\n> bar\n", "html": "\n\n", - "example": 183, - "start_line": 3082, - "end_line": 3091, + "example": 214, + "start_line": 3452, + "end_line": 3461, "section": "Link reference definitions" }, { "markdown": "[foo]: /url\nbar\n===\n[foo]\n", "html": "bar
\n
===\nfoo
\n", - "example": 185, - "start_line": 3103, - "end_line": 3110, + "example": 216, + "start_line": 3473, + "end_line": 3480, "section": "Link reference definitions" }, { "markdown": "[foo]: /foo-url \"foo\"\n[bar]: /bar-url\n \"bar\"\n[baz]: /baz-url\n\n[foo],\n[bar],\n[baz]\n", "html": "\n", - "example": 186, - "start_line": 3116, - "end_line": 3129, + "example": 217, + "start_line": 3486, + "end_line": 3499, "section": "Link reference definitions" }, { "markdown": "[foo]\n\n> [foo]: /url\n", "html": "\n\n\n", - "example": 187, - "start_line": 3137, - "end_line": 3145, - "section": "Link reference definitions" - }, - { - "markdown": "[foo]: /url\n", - "html": "", - "example": 188, - "start_line": 3154, - "end_line": 3157, + "example": 218, + "start_line": 3507, + "end_line": 3515, "section": "Link reference definitions" }, { "markdown": "aaa\n\nbbb\n", "html": "
aaa
\nbbb
\n", - "example": 189, - "start_line": 3171, - "end_line": 3178, + "example": 219, + "start_line": 3529, + "end_line": 3536, "section": "Paragraphs" }, { "markdown": "aaa\nbbb\n\nccc\nddd\n", "html": "aaa\nbbb
\nccc\nddd
\n", - "example": 190, - "start_line": 3183, - "end_line": 3194, + "example": 220, + "start_line": 3541, + "end_line": 3552, "section": "Paragraphs" }, { "markdown": "aaa\n\n\nbbb\n", "html": "aaa
\nbbb
\n", - "example": 191, - "start_line": 3199, - "end_line": 3207, + "example": 221, + "start_line": 3557, + "end_line": 3565, "section": "Paragraphs" }, { "markdown": " aaa\n bbb\n", "html": "aaa\nbbb
\n", - "example": 192, - "start_line": 3212, - "end_line": 3218, + "example": 222, + "start_line": 3570, + "end_line": 3576, "section": "Paragraphs" }, { "markdown": "aaa\n bbb\n ccc\n", "html": "aaa\nbbb\nccc
\n", - "example": 193, - "start_line": 3224, - "end_line": 3232, + "example": 223, + "start_line": 3582, + "end_line": 3590, "section": "Paragraphs" }, { "markdown": " aaa\nbbb\n", "html": "aaa\nbbb
\n", - "example": 194, - "start_line": 3238, - "end_line": 3244, + "example": 224, + "start_line": 3596, + "end_line": 3602, "section": "Paragraphs" }, { "markdown": " aaa\nbbb\n", "html": "aaa\n
\nbbb
\n", - "example": 195, - "start_line": 3247, - "end_line": 3254, + "example": 225, + "start_line": 3605, + "end_line": 3612, "section": "Paragraphs" }, { "markdown": "aaa \nbbb \n", "html": "aaa
\nbbb
aaa
\n\n\n", - "example": 198, - "start_line": 3344, - "end_line": 3354, + "example": 228, + "start_line": 3704, + "end_line": 3714, "section": "Block quotes" }, { "markdown": "># Foo\n>bar\n> baz\n", "html": "Foo
\nbar\nbaz
\n
\n\n", - "example": 199, - "start_line": 3359, - "end_line": 3369, + "example": 229, + "start_line": 3719, + "end_line": 3729, "section": "Block quotes" }, { "markdown": " > # Foo\n > bar\n > baz\n", "html": "Foo
\nbar\nbaz
\n
\n\n", - "example": 200, - "start_line": 3374, - "end_line": 3384, + "example": 230, + "start_line": 3734, + "end_line": 3744, "section": "Block quotes" }, { "markdown": " > # Foo\n > bar\n > baz\n", "html": "Foo
\nbar\nbaz
\n
> # Foo\n> bar\n> baz\n
\n",
- "example": 201,
- "start_line": 3389,
- "end_line": 3398,
+ "example": 231,
+ "start_line": 3749,
+ "end_line": 3758,
"section": "Block quotes"
},
{
"markdown": "> # Foo\n> bar\nbaz\n",
"html": "\n\n", - "example": 202, - "start_line": 3404, - "end_line": 3414, + "example": 232, + "start_line": 3764, + "end_line": 3774, "section": "Block quotes" }, { "markdown": "> bar\nbaz\n> foo\n", "html": "Foo
\nbar\nbaz
\n
\n\n", - "example": 203, - "start_line": 3420, - "end_line": 3430, + "example": 233, + "start_line": 3780, + "end_line": 3790, "section": "Block quotes" }, { "markdown": "> foo\n---\n", "html": "bar\nbaz\nfoo
\n
\n\nfoo
\n
\n\n\n
\n- foo
\n
\n\n\nfoo\n
bar\n
\n",
- "example": 206,
- "start_line": 3482,
- "end_line": 3492,
+ "example": 236,
+ "start_line": 3842,
+ "end_line": 3852,
"section": "Block quotes",
"shouldFail": true
},
{
"markdown": "> ```\nfoo\n```\n",
"html": "\n\n\n
foo
\n
\n",
- "example": 207,
- "start_line": 3495,
- "end_line": 3505,
+ "example": 237,
+ "start_line": 3855,
+ "end_line": 3865,
"section": "Block quotes",
"shouldFail": true
},
{
"markdown": "> foo\n - bar\n",
"html": "\n\n", - "example": 208, - "start_line": 3511, - "end_line": 3519, + "example": 238, + "start_line": 3871, + "end_line": 3879, "section": "Block quotes" }, { "markdown": ">\n", "html": "foo\n- bar
\n
\n\n", - "example": 209, - "start_line": 3535, - "end_line": 3540, + "example": 239, + "start_line": 3895, + "end_line": 3900, "section": "Block quotes" }, { "markdown": ">\n> \n> \n", "html": "
\n\n", - "example": 210, - "start_line": 3543, - "end_line": 3550, + "example": 240, + "start_line": 3903, + "end_line": 3910, "section": "Block quotes" }, { "markdown": ">\n> foo\n> \n", "html": "
\n\n", - "example": 211, - "start_line": 3555, - "end_line": 3563, + "example": 241, + "start_line": 3915, + "end_line": 3923, "section": "Block quotes" }, { "markdown": "> foo\n\n> bar\n", "html": "foo
\n
\n\nfoo
\n
\n\n", - "example": 212, - "start_line": 3568, - "end_line": 3579, + "example": 242, + "start_line": 3928, + "end_line": 3939, "section": "Block quotes" }, { "markdown": "> foo\n> bar\n", "html": "bar
\n
\n\n", - "example": 213, - "start_line": 3590, - "end_line": 3598, + "example": 243, + "start_line": 3950, + "end_line": 3958, "section": "Block quotes" }, { "markdown": "> foo\n>\n> bar\n", "html": "foo\nbar
\n
\n\n", - "example": 214, - "start_line": 3603, - "end_line": 3612, + "example": 244, + "start_line": 3963, + "end_line": 3972, "section": "Block quotes" }, { "markdown": "foo\n> bar\n", "html": "foo
\nbar
\n
foo
\n\n\n", - "example": 215, - "start_line": 3617, - "end_line": 3625, + "example": 245, + "start_line": 3977, + "end_line": 3985, "section": "Block quotes" }, { "markdown": "> aaa\n***\n> bbb\n", "html": "bar
\n
\n\naaa
\n
\n\n", - "example": 216, - "start_line": 3631, - "end_line": 3643, + "example": 246, + "start_line": 3991, + "end_line": 4003, "section": "Block quotes" }, { "markdown": "> bar\nbaz\n", "html": "bbb
\n
\n\n", - "example": 217, - "start_line": 3649, - "end_line": 3657, + "example": 247, + "start_line": 4009, + "end_line": 4017, "section": "Block quotes" }, { "markdown": "> bar\n\nbaz\n", "html": "bar\nbaz
\n
\n\nbar
\n
baz
\n", - "example": 218, - "start_line": 3660, - "end_line": 3669, + "example": 248, + "start_line": 4020, + "end_line": 4029, "section": "Block quotes" }, { "markdown": "> bar\n>\nbaz\n", "html": "\n\nbar
\n
baz
\n", - "example": 219, - "start_line": 3672, - "end_line": 3681, + "example": 249, + "start_line": 4032, + "end_line": 4041, "section": "Block quotes" }, { "markdown": "> > > foo\nbar\n", "html": "\n\n", - "example": 220, - "start_line": 3688, - "end_line": 3700, + "example": 250, + "start_line": 4048, + "end_line": 4060, "section": "Block quotes" }, { "markdown": ">>> foo\n> bar\n>>baz\n", "html": "\n\n\n\nfoo\nbar
\n
\n\n", - "example": 221, - "start_line": 3703, - "end_line": 3717, + "example": 251, + "start_line": 4063, + "end_line": 4077, "section": "Block quotes" }, { "markdown": "> code\n\n> not code\n", "html": "\n\n\n\nfoo\nbar\nbaz
\n
\n\n\ncode\n
\n\n", - "example": 222, - "start_line": 3725, - "end_line": 3737, + "example": 252, + "start_line": 4085, + "end_line": 4097, "section": "Block quotes" }, { "markdown": "A paragraph\nwith two lines.\n\n indented code\n\n> A block quote.\n", "html": "not code
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\n", - "example": 223, - "start_line": 3779, - "end_line": 3794, + "example": 253, + "start_line": 4139, + "end_line": 4154, "section": "List items" }, { "markdown": "1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", "html": "A block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
two
\n", - "example": 225, - "start_line": 3834, - "end_line": 3843, + "example": 255, + "start_line": 4194, + "end_line": 4203, "section": "List items" }, { "markdown": "- one\n\n two\n", "html": "one
\ntwo
\n two\n
\n",
- "example": 227,
- "start_line": 3860,
- "end_line": 3870,
+ "example": 257,
+ "start_line": 4220,
+ "end_line": 4230,
"section": "List items"
},
{
"markdown": " - one\n\n two\n",
"html": "one
\ntwo
\n\n\n", - "example": 229, - "start_line": 3895, - "end_line": 3910, + "example": 259, + "start_line": 4255, + "end_line": 4270, "section": "List items" }, { "markdown": ">>- one\n>>\n > > two\n", "html": "\n\n\n
\n- \n
\none
\ntwo
\n
\n\n", - "example": 230, - "start_line": 3922, - "end_line": 3935, + "example": 260, + "start_line": 4282, + "end_line": 4295, "section": "List items" }, { "markdown": "-one\n\n2.two\n", "html": "\n\n\n
\n- one
\ntwo
\n
-one
\n2.two
\n", - "example": 231, - "start_line": 3941, - "end_line": 3948, + "example": 261, + "start_line": 4301, + "end_line": 4308, "section": "List items" }, { "markdown": "- foo\n\n\n bar\n", "html": "foo
\nbar
\nfoo
\nbar\n
\nbaz
\n\n\nbam
\n
Foo
\nbar\n\n\nbaz\n
\n1234567890. not ok
\n", - "example": 236, - "start_line": 4030, - "end_line": 4034, + "example": 266, + "start_line": 4390, + "end_line": 4394, "section": "List items" }, { "markdown": "0. ok\n", "html": "-1. not ok
\n", - "example": 239, - "start_line": 4059, - "end_line": 4063, + "example": 269, + "start_line": 4419, + "end_line": 4423, "section": "List items" }, { "markdown": "- foo\n\n bar\n", "html": "foo
\nbar\n
\nfoo
\nbar\n
\nindented code\n
\nparagraph
\nmore code\n
\n",
- "example": 242,
- "start_line": 4118,
- "end_line": 4130,
+ "example": 272,
+ "start_line": 4478,
+ "end_line": 4490,
"section": "List items"
},
{
"markdown": "1. indented code\n\n paragraph\n\n more code\n",
"html": "indented code\n
\nparagraph
\nmore code\n
\n indented code\n
\nparagraph
\nmore code\n
\nfoo
\nbar
\n", - "example": 245, - "start_line": 4182, - "end_line": 4189, + "example": 275, + "start_line": 4542, + "end_line": 4549, "section": "List items" }, { "markdown": "- foo\n\n bar\n", "html": "bar
\n", - "example": 246, - "start_line": 4192, - "end_line": 4201, + "example": 276, + "start_line": 4552, + "end_line": 4561, "section": "List items" }, { "markdown": "- foo\n\n bar\n", "html": "foo
\nbar
\nbar\n
\nbaz\n
\nfoo
\n", - "example": 250, - "start_line": 4277, - "end_line": 4286, + "example": 280, + "start_line": 4636, + "end_line": 4645, "section": "List items", "shouldFail": true }, { "markdown": "- foo\n-\n- bar\n", "html": "foo\n*
\nfoo\n1.
\n", - "example": 255, - "start_line": 4346, - "end_line": 4357, + "example": 285, + "start_line": 4705, + "end_line": 4716, "section": "List items" }, { "markdown": " 1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n", - "html": "A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
1. A paragraph\n with two lines.\n\n indented code\n\n > A block quote.\n
\n",
- "example": 259,
- "start_line": 4440,
- "end_line": 4455,
+ "example": 289,
+ "start_line": 4799,
+ "end_line": 4814,
"section": "List items"
},
{
"markdown": " 1. A paragraph\nwith two lines.\n\n indented code\n\n > A block quote.\n",
"html": "A paragraph\nwith two lines.
\nindented code\n
\n\n\nA block quote.
\n
\n\n", - "example": 262, - "start_line": 4507, - "end_line": 4521, + "example": 292, + "start_line": 4866, + "end_line": 4880, "section": "List items" }, { "markdown": "> 1. > Blockquote\n> continued here.\n", "html": "\n
\n- \n
\n\n\nBlockquote\ncontinued here.
\n
\n\n", - "example": 263, - "start_line": 4524, - "end_line": 4538, + "example": 293, + "start_line": 4883, + "end_line": 4897, "section": "List items" }, { "markdown": "- foo\n - bar\n - baz\n - boo\n", "html": "\n
\n- \n
\n\n\nBlockquote\ncontinued here.
\n
Foo
\nThe number of windows in my house is\n14. The number of doors is 6.
\n", - "example": 274, - "start_line": 5005, - "end_line": 5011, + "example": 304, + "start_line": 5364, + "end_line": 5370, "section": "Lists" }, { "markdown": "The number of windows in my house is\n1. The number of doors is 6.\n", "html": "The number of windows in my house is
\nfoo
\nbar
\nbaz
\nbaz
\nbim
\nfoo
\nnotcode
\nfoo
\ncode\n
\n",
- "example": 279,
- "start_line": 5101,
- "end_line": 5124,
+ "example": 309,
+ "start_line": 5460,
+ "end_line": 5483,
"section": "Lists"
},
{
"markdown": "- a\n - b\n - c\n - d\n - e\n - f\n- g\n",
"html": "a
\nb
\nc
\na
\nb
\n3. c\n
\n",
- "example": 283,
- "start_line": 5197,
- "end_line": 5214,
+ "example": 313,
+ "start_line": 5556,
+ "end_line": 5573,
"section": "Lists"
},
{
"markdown": "- a\n- b\n\n- c\n",
"html": "a
\nb
\nc
\na
\nc
\na
\nb
\nc
\nd
\na
\nb
\nd
\nb\n\n\n
\nb
\nc
\n\n\nb
\n
\n\nb
\n
c\n
\nfoo\n
\nbar
\nfoo
\nbaz
\na
\nd
\nhi
lo`
!"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~
\n", - "example": 298, - "start_line": 5513, - "end_line": 5517, - "section": "Backslash escapes" - }, - { - "markdown": "\\\t\\A\\a\\ \\3\\φ\\«\n", - "html": "\\\t\\A\\a\\ \\3\\φ\\«
\n", - "example": 299, - "start_line": 5523, - "end_line": 5527, - "section": "Backslash escapes" - }, - { - "markdown": "\\*not emphasized*\n\\*not emphasized*\n<br/> not a tag\n[not a link](/foo)\n`not code`\n1. not a list\n* not a list\n# not a heading\n[foo]: /url "not a reference"\nö not a character entity
\n", - "example": 300, - "start_line": 5533, - "end_line": 5553, - "section": "Backslash escapes" - }, - { - "markdown": "\\\\*emphasis*\n", - "html": "\\emphasis
\n", - "example": 301, - "start_line": 5558, - "end_line": 5562, - "section": "Backslash escapes" - }, - { - "markdown": "foo\\\nbar\n", - "html": "foo
\nbar
\\[\\`
\\[\\]\n
\n",
- "example": 304,
- "start_line": 5586,
- "end_line": 5591,
- "section": "Backslash escapes"
- },
- {
- "markdown": "~~~\n\\[\\]\n~~~\n",
- "html": "\\[\\]\n
\n",
- "example": 305,
- "start_line": 5594,
- "end_line": 5601,
- "section": "Backslash escapes"
- },
- {
- "markdown": "foo\n
\n",
- "example": 310,
- "start_line": 5637,
- "end_line": 5644,
- "section": "Backslash escapes",
- "shouldFail": true
- },
- {
- "markdown": " & © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸\n",
- "html": "& © Æ Ď\n¾ ℋ ⅆ\n∲ ≧̸
\n", - "example": 311, - "start_line": 5674, - "end_line": 5682, - "section": "Entity and numeric character references" - }, - { - "markdown": "# Ӓ Ϡ \n", - "html": "# Ӓ Ϡ �
\n", - "example": 312, - "start_line": 5693, - "end_line": 5697, - "section": "Entity and numeric character references" - }, - { - "markdown": "" ആ ಫ\n", - "html": "" ആ ಫ
\n", - "example": 313, - "start_line": 5706, - "end_line": 5710, - "section": "Entity and numeric character references" - }, - { - "markdown": "  &x; \n\nabcdef0;\n&ThisIsNotDefined; &hi?;\n", - "html": "  &x; &#; &#x;\n�\n&#abcdef0;\n&ThisIsNotDefined; &hi?;
\n", - "example": 314, - "start_line": 5715, - "end_line": 5725, - "section": "Entity and numeric character references", - "shouldFail": true - }, - { - "markdown": "©\n", - "html": "©
\n", - "example": 315, - "start_line": 5732, - "end_line": 5736, - "section": "Entity and numeric character references" - }, - { - "markdown": "&MadeUpEntity;\n", - "html": "&MadeUpEntity;
\n", - "example": 316, - "start_line": 5742, - "end_line": 5746, - "section": "Entity and numeric character references" - }, - { - "markdown": "\n", - "html": "\n", - "example": 317, - "start_line": 5753, - "end_line": 5757, - "section": "Entity and numeric character references" - }, - { - "markdown": "[foo](/föö \"föö\")\n", - "html": "\n", - "example": 318, - "start_line": 5760, - "end_line": 5764, - "section": "Entity and numeric character references", - "shouldFail": true - }, - { - "markdown": "[foo]\n\n[foo]: /föö \"föö\"\n", - "html": "\n", "example": 319, - "start_line": 5767, - "end_line": 5773, - "section": "Entity and numeric character references", + "start_line": 5694, + "end_line": 5712, + "section": "Lists", "shouldFail": true }, { - "markdown": "``` föö\nfoo\n```\n", - "html": "foo\n
\n",
+ "markdown": "* a\n > b\n >\n* c\n",
+ "html": "\n\nb
\n
föö
\n\nb
\n
c\n
\nföfö\n
\n",
+ "markdown": "- a\n",
+ "html": "*foo*\nfoo
\n", + "markdown": "- a\n - b\n", + "html": "* foo
\nfoo\n
\nbar
\nfoo\n\nbar
\n", + "markdown": "* foo\n * bar\n\n baz\n", + "html": "foo
\nbaz
\n\tfoo
\n", + "markdown": "- a\n - b\n - c\n\n- d\n - e\n - f\n", + "html": "a
\nd
\n[a](url "tit")
\n", + "markdown": "`hi`lo`\n", + "html": "hi
lo`
foo
foo ` bar
``
``
a
b
\n
foo bar baz
foo
foo bar baz
foo\\
bar`
foo`bar
foo `` bar
*foo*
[not a link](/foo
)
<a href="
">`
<http://foo.bar.
baz>`
```foo``
\n", "example": 347, - "start_line": 6059, - "end_line": 6063, + "start_line": 6079, + "end_line": 6083, "section": "Code spans" }, { "markdown": "`foo\n", "html": "`foo
\n", "example": 348, - "start_line": 6066, - "end_line": 6070, + "start_line": 6086, + "end_line": 6090, "section": "Code spans" }, { "markdown": "`foo``bar``\n", "html": "`foobar
foo bar
\n", "example": 350, - "start_line": 6292, - "end_line": 6296, + "start_line": 6312, + "end_line": 6316, "section": "Emphasis and strong emphasis" }, { "markdown": "a * foo bar*\n", "html": "a * foo bar*
\n", "example": 351, - "start_line": 6302, - "end_line": 6306, + "start_line": 6322, + "end_line": 6326, "section": "Emphasis and strong emphasis" }, { "markdown": "a*\"foo\"*\n", "html": "a*"foo"*
\n", "example": 352, - "start_line": 6313, - "end_line": 6317, + "start_line": 6333, + "end_line": 6337, "section": "Emphasis and strong emphasis" }, { "markdown": "* a *\n", "html": "* a *
\n", "example": 353, - "start_line": 6322, - "end_line": 6326, + "start_line": 6342, + "end_line": 6346, "section": "Emphasis and strong emphasis" }, { "markdown": "foo*bar*\n", "html": "foobar
\n", "example": 354, - "start_line": 6331, - "end_line": 6335, + "start_line": 6351, + "end_line": 6355, "section": "Emphasis and strong emphasis" }, { "markdown": "5*6*78\n", "html": "5678
\n", "example": 355, - "start_line": 6338, - "end_line": 6342, + "start_line": 6358, + "end_line": 6362, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo bar_\n", "html": "foo bar
\n", "example": 356, - "start_line": 6347, - "end_line": 6351, + "start_line": 6367, + "end_line": 6371, "section": "Emphasis and strong emphasis" }, { "markdown": "_ foo bar_\n", "html": "_ foo bar_
\n", "example": 357, - "start_line": 6357, - "end_line": 6361, + "start_line": 6377, + "end_line": 6381, "section": "Emphasis and strong emphasis" }, { "markdown": "a_\"foo\"_\n", "html": "a_"foo"_
\n", "example": 358, - "start_line": 6367, - "end_line": 6371, + "start_line": 6387, + "end_line": 6391, "section": "Emphasis and strong emphasis" }, { "markdown": "foo_bar_\n", "html": "foo_bar_
\n", "example": 359, - "start_line": 6376, - "end_line": 6380, + "start_line": 6396, + "end_line": 6400, "section": "Emphasis and strong emphasis" }, { "markdown": "5_6_78\n", "html": "5_6_78
\n", "example": 360, - "start_line": 6383, - "end_line": 6387, + "start_line": 6403, + "end_line": 6407, "section": "Emphasis and strong emphasis" }, { "markdown": "пристаням_стремятся_\n", "html": "пристаням_стремятся_
\n", "example": 361, - "start_line": 6390, - "end_line": 6394, + "start_line": 6410, + "end_line": 6414, "section": "Emphasis and strong emphasis" }, { "markdown": "aa_\"bb\"_cc\n", "html": "aa_"bb"_cc
\n", "example": 362, - "start_line": 6400, - "end_line": 6404, + "start_line": 6420, + "end_line": 6424, "section": "Emphasis and strong emphasis" }, { "markdown": "foo-_(bar)_\n", "html": "foo-(bar)
\n", "example": 363, - "start_line": 6411, - "end_line": 6415, + "start_line": 6431, + "end_line": 6435, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo*\n", "html": "_foo*
\n", "example": 364, - "start_line": 6423, - "end_line": 6427, + "start_line": 6443, + "end_line": 6447, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo bar *\n", "html": "*foo bar *
\n", "example": 365, - "start_line": 6433, - "end_line": 6437, + "start_line": 6453, + "end_line": 6457, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo bar\n*\n", "html": "*foo bar\n*
\n", "example": 366, - "start_line": 6442, - "end_line": 6448, + "start_line": 6462, + "end_line": 6468, "section": "Emphasis and strong emphasis" }, { "markdown": "*(*foo)\n", "html": "*(*foo)
\n", "example": 367, - "start_line": 6455, - "end_line": 6459, + "start_line": 6475, + "end_line": 6479, "section": "Emphasis and strong emphasis" }, { "markdown": "*(*foo*)*\n", "html": "(foo)
\n", "example": 368, - "start_line": 6465, - "end_line": 6469, + "start_line": 6485, + "end_line": 6489, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo*bar\n", "html": "foobar
\n", "example": 369, - "start_line": 6474, - "end_line": 6478, + "start_line": 6494, + "end_line": 6498, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo bar _\n", "html": "_foo bar _
\n", "example": 370, - "start_line": 6487, - "end_line": 6491, + "start_line": 6507, + "end_line": 6511, "section": "Emphasis and strong emphasis" }, { "markdown": "_(_foo)\n", "html": "_(_foo)
\n", "example": 371, - "start_line": 6497, - "end_line": 6501, + "start_line": 6517, + "end_line": 6521, "section": "Emphasis and strong emphasis" }, { "markdown": "_(_foo_)_\n", "html": "(foo)
\n", "example": 372, - "start_line": 6506, - "end_line": 6510, + "start_line": 6526, + "end_line": 6530, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo_bar\n", "html": "_foo_bar
\n", "example": 373, - "start_line": 6515, - "end_line": 6519, + "start_line": 6535, + "end_line": 6539, "section": "Emphasis and strong emphasis" }, { "markdown": "_пристаням_стремятся\n", "html": "_пристаням_стремятся
\n", "example": 374, - "start_line": 6522, - "end_line": 6526, + "start_line": 6542, + "end_line": 6546, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo_bar_baz_\n", "html": "foo_bar_baz
\n", "example": 375, - "start_line": 6529, - "end_line": 6533, + "start_line": 6549, + "end_line": 6553, "section": "Emphasis and strong emphasis" }, { "markdown": "_(bar)_.\n", "html": "(bar).
\n", "example": 376, - "start_line": 6540, - "end_line": 6544, + "start_line": 6560, + "end_line": 6564, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo bar**\n", "html": "foo bar
\n", "example": 377, - "start_line": 6549, - "end_line": 6553, + "start_line": 6569, + "end_line": 6573, "section": "Emphasis and strong emphasis" }, { "markdown": "** foo bar**\n", "html": "** foo bar**
\n", "example": 378, - "start_line": 6559, - "end_line": 6563, + "start_line": 6579, + "end_line": 6583, "section": "Emphasis and strong emphasis" }, { "markdown": "a**\"foo\"**\n", "html": "a**"foo"**
\n", "example": 379, - "start_line": 6570, - "end_line": 6574, + "start_line": 6590, + "end_line": 6594, "section": "Emphasis and strong emphasis" }, { "markdown": "foo**bar**\n", "html": "foobar
\n", "example": 380, - "start_line": 6579, - "end_line": 6583, + "start_line": 6599, + "end_line": 6603, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo bar__\n", "html": "foo bar
\n", "example": 381, - "start_line": 6588, - "end_line": 6592, + "start_line": 6608, + "end_line": 6612, "section": "Emphasis and strong emphasis" }, { "markdown": "__ foo bar__\n", "html": "__ foo bar__
\n", "example": 382, - "start_line": 6598, - "end_line": 6602, + "start_line": 6618, + "end_line": 6622, "section": "Emphasis and strong emphasis" }, { "markdown": "__\nfoo bar__\n", "html": "__\nfoo bar__
\n", "example": 383, - "start_line": 6606, - "end_line": 6612, + "start_line": 6626, + "end_line": 6632, "section": "Emphasis and strong emphasis" }, { "markdown": "a__\"foo\"__\n", "html": "a__"foo"__
\n", "example": 384, - "start_line": 6618, - "end_line": 6622, + "start_line": 6638, + "end_line": 6642, "section": "Emphasis and strong emphasis" }, { "markdown": "foo__bar__\n", "html": "foo__bar__
\n", "example": 385, - "start_line": 6627, - "end_line": 6631, + "start_line": 6647, + "end_line": 6651, "section": "Emphasis and strong emphasis" }, { "markdown": "5__6__78\n", "html": "5__6__78
\n", "example": 386, - "start_line": 6634, - "end_line": 6638, + "start_line": 6654, + "end_line": 6658, "section": "Emphasis and strong emphasis" }, { "markdown": "пристаням__стремятся__\n", "html": "пристаням__стремятся__
\n", "example": 387, - "start_line": 6641, - "end_line": 6645, + "start_line": 6661, + "end_line": 6665, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo, __bar__, baz__\n", "html": "foo, bar, baz
\n", "example": 388, - "start_line": 6648, - "end_line": 6652, + "start_line": 6668, + "end_line": 6672, "section": "Emphasis and strong emphasis" }, { "markdown": "foo-__(bar)__\n", "html": "foo-(bar)
\n", "example": 389, - "start_line": 6659, - "end_line": 6663, + "start_line": 6679, + "end_line": 6683, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo bar **\n", "html": "**foo bar **
\n", "example": 390, - "start_line": 6672, - "end_line": 6676, + "start_line": 6692, + "end_line": 6696, "section": "Emphasis and strong emphasis" }, { "markdown": "**(**foo)\n", "html": "**(**foo)
\n", "example": 391, - "start_line": 6685, - "end_line": 6689, + "start_line": 6705, + "end_line": 6709, "section": "Emphasis and strong emphasis" }, { "markdown": "*(**foo**)*\n", "html": "(foo)
\n", "example": 392, - "start_line": 6695, - "end_line": 6699, + "start_line": 6715, + "end_line": 6719, "section": "Emphasis and strong emphasis" }, { "markdown": "**Gomphocarpus (*Gomphocarpus physocarpus*, syn.\n*Asclepias physocarpa*)**\n", "html": "Gomphocarpus (Gomphocarpus physocarpus, syn.\nAsclepias physocarpa)
\n", "example": 393, - "start_line": 6702, - "end_line": 6708, + "start_line": 6722, + "end_line": 6728, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo \"*bar*\" foo**\n", "html": "foo "bar" foo
\n", "example": 394, - "start_line": 6711, - "end_line": 6715, + "start_line": 6731, + "end_line": 6735, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo**bar\n", "html": "foobar
\n", "example": 395, - "start_line": 6720, - "end_line": 6724, + "start_line": 6740, + "end_line": 6744, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo bar __\n", "html": "__foo bar __
\n", "example": 396, - "start_line": 6732, - "end_line": 6736, + "start_line": 6752, + "end_line": 6756, "section": "Emphasis and strong emphasis" }, { "markdown": "__(__foo)\n", "html": "__(__foo)
\n", "example": 397, - "start_line": 6742, - "end_line": 6746, + "start_line": 6762, + "end_line": 6766, "section": "Emphasis and strong emphasis" }, { "markdown": "_(__foo__)_\n", "html": "(foo)
\n", "example": 398, - "start_line": 6752, - "end_line": 6756, + "start_line": 6772, + "end_line": 6776, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__bar\n", "html": "__foo__bar
\n", "example": 399, - "start_line": 6761, - "end_line": 6765, + "start_line": 6781, + "end_line": 6785, "section": "Emphasis and strong emphasis" }, { "markdown": "__пристаням__стремятся\n", "html": "__пристаням__стремятся
\n", "example": 400, - "start_line": 6768, - "end_line": 6772, + "start_line": 6788, + "end_line": 6792, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__bar__baz__\n", "html": "foo__bar__baz
\n", "example": 401, - "start_line": 6775, - "end_line": 6779, + "start_line": 6795, + "end_line": 6799, "section": "Emphasis and strong emphasis" }, { "markdown": "__(bar)__.\n", "html": "(bar).
\n", "example": 402, - "start_line": 6786, - "end_line": 6790, + "start_line": 6806, + "end_line": 6810, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo [bar](/url)*\n", "html": "foo bar
\n", "example": 403, - "start_line": 6798, - "end_line": 6802, + "start_line": 6818, + "end_line": 6822, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo\nbar*\n", "html": "foo\nbar
\n", "example": 404, - "start_line": 6805, - "end_line": 6811, + "start_line": 6825, + "end_line": 6831, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo __bar__ baz_\n", "html": "foo bar baz
\n", "example": 405, - "start_line": 6817, - "end_line": 6821, + "start_line": 6837, + "end_line": 6841, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo _bar_ baz_\n", "html": "foo bar baz
\n", "example": 406, - "start_line": 6824, - "end_line": 6828, + "start_line": 6844, + "end_line": 6848, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo_ bar_\n", "html": "foo bar
\n", "example": 407, - "start_line": 6831, - "end_line": 6835, + "start_line": 6851, + "end_line": 6855, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo *bar**\n", "html": "foo bar
\n", "example": 408, - "start_line": 6838, - "end_line": 6842, + "start_line": 6858, + "end_line": 6862, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo **bar** baz*\n", "html": "foo bar baz
\n", "example": 409, - "start_line": 6845, - "end_line": 6849, + "start_line": 6865, + "end_line": 6869, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**bar**baz*\n", "html": "foobarbaz
\n", "example": 410, - "start_line": 6851, - "end_line": 6855, + "start_line": 6871, + "end_line": 6875, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**bar*\n", "html": "foo**bar
\n", "example": 411, - "start_line": 6875, - "end_line": 6879, + "start_line": 6895, + "end_line": 6899, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo** bar*\n", "html": "foo bar
\n", "example": 412, - "start_line": 6888, - "end_line": 6892, + "start_line": 6908, + "end_line": 6912, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo **bar***\n", "html": "foo bar
\n", "example": 413, - "start_line": 6895, - "end_line": 6899, + "start_line": 6915, + "end_line": 6919, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**bar***\n", "html": "foobar
\n", "example": 414, - "start_line": 6902, - "end_line": 6906, + "start_line": 6922, + "end_line": 6926, "section": "Emphasis and strong emphasis" }, { "markdown": "foo***bar***baz\n", "html": "foobarbaz
\n", "example": 415, - "start_line": 6913, - "end_line": 6917, + "start_line": 6933, + "end_line": 6937, "section": "Emphasis and strong emphasis" }, { "markdown": "foo******bar*********baz\n", "html": "foobar***baz
\n", "example": 416, - "start_line": 6919, - "end_line": 6923, + "start_line": 6939, + "end_line": 6943, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo **bar *baz* bim** bop*\n", "html": "foo bar baz bim bop
\n", "example": 417, - "start_line": 6928, - "end_line": 6932, + "start_line": 6948, + "end_line": 6952, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo [*bar*](/url)*\n", "html": "foo bar
\n", "example": 418, - "start_line": 6935, - "end_line": 6939, + "start_line": 6955, + "end_line": 6959, "section": "Emphasis and strong emphasis" }, { "markdown": "** is not an empty emphasis\n", "html": "** is not an empty emphasis
\n", "example": 419, - "start_line": 6944, - "end_line": 6948, + "start_line": 6964, + "end_line": 6968, "section": "Emphasis and strong emphasis" }, { "markdown": "**** is not an empty strong emphasis\n", "html": "**** is not an empty strong emphasis
\n", "example": 420, - "start_line": 6951, - "end_line": 6955, + "start_line": 6971, + "end_line": 6975, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo [bar](/url)**\n", "html": "foo bar
\n", "example": 421, - "start_line": 6964, - "end_line": 6968, + "start_line": 6984, + "end_line": 6988, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo\nbar**\n", "html": "foo\nbar
\n", "example": 422, - "start_line": 6971, - "end_line": 6977, + "start_line": 6991, + "end_line": 6997, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo _bar_ baz__\n", "html": "foo bar baz
\n", "example": 423, - "start_line": 6983, - "end_line": 6987, + "start_line": 7003, + "end_line": 7007, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo __bar__ baz__\n", "html": "foo bar baz
\n", "example": 424, - "start_line": 6990, - "end_line": 6994, + "start_line": 7010, + "end_line": 7014, "section": "Emphasis and strong emphasis" }, { "markdown": "____foo__ bar__\n", "html": "foo bar
\n", "example": 425, - "start_line": 6997, - "end_line": 7001, + "start_line": 7017, + "end_line": 7021, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo **bar****\n", "html": "foo bar
\n", "example": 426, - "start_line": 7004, - "end_line": 7008, + "start_line": 7024, + "end_line": 7028, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo *bar* baz**\n", "html": "foo bar baz
\n", "example": 427, - "start_line": 7011, - "end_line": 7015, + "start_line": 7031, + "end_line": 7035, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo*bar*baz**\n", "html": "foobarbaz
\n", "example": 428, - "start_line": 7018, - "end_line": 7022, + "start_line": 7038, + "end_line": 7042, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo* bar**\n", "html": "foo bar
\n", "example": 429, - "start_line": 7025, - "end_line": 7029, + "start_line": 7045, + "end_line": 7049, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo *bar***\n", "html": "foo bar
\n", "example": 430, - "start_line": 7032, - "end_line": 7036, + "start_line": 7052, + "end_line": 7056, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo *bar **baz**\nbim* bop**\n", "html": "foo bar baz\nbim bop
\n", "example": 431, - "start_line": 7041, - "end_line": 7047, + "start_line": 7061, + "end_line": 7067, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo [*bar*](/url)**\n", "html": "foo bar
\n", "example": 432, - "start_line": 7050, - "end_line": 7054, + "start_line": 7070, + "end_line": 7074, "section": "Emphasis and strong emphasis" }, { "markdown": "__ is not an empty emphasis\n", "html": "__ is not an empty emphasis
\n", "example": 433, - "start_line": 7059, - "end_line": 7063, + "start_line": 7079, + "end_line": 7083, "section": "Emphasis and strong emphasis" }, { "markdown": "____ is not an empty strong emphasis\n", "html": "____ is not an empty strong emphasis
\n", "example": 434, - "start_line": 7066, - "end_line": 7070, + "start_line": 7086, + "end_line": 7090, "section": "Emphasis and strong emphasis" }, { "markdown": "foo ***\n", "html": "foo ***
\n", "example": 435, - "start_line": 7076, - "end_line": 7080, + "start_line": 7096, + "end_line": 7100, "section": "Emphasis and strong emphasis" }, { "markdown": "foo *\\**\n", "html": "foo *
\n", "example": 436, - "start_line": 7083, - "end_line": 7087, + "start_line": 7103, + "end_line": 7107, "section": "Emphasis and strong emphasis" }, { "markdown": "foo *_*\n", "html": "foo _
\n", "example": 437, - "start_line": 7090, - "end_line": 7094, + "start_line": 7110, + "end_line": 7114, "section": "Emphasis and strong emphasis" }, { "markdown": "foo *****\n", "html": "foo *****
\n", "example": 438, - "start_line": 7097, - "end_line": 7101, + "start_line": 7117, + "end_line": 7121, "section": "Emphasis and strong emphasis" }, { "markdown": "foo **\\***\n", "html": "foo *
\n", "example": 439, - "start_line": 7104, - "end_line": 7108, + "start_line": 7124, + "end_line": 7128, "section": "Emphasis and strong emphasis" }, { "markdown": "foo **_**\n", "html": "foo _
\n", "example": 440, - "start_line": 7111, - "end_line": 7115, + "start_line": 7131, + "end_line": 7135, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo*\n", "html": "*foo
\n", "example": 441, - "start_line": 7122, - "end_line": 7126, + "start_line": 7142, + "end_line": 7146, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo**\n", "html": "foo*
\n", "example": 442, - "start_line": 7129, - "end_line": 7133, + "start_line": 7149, + "end_line": 7153, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo**\n", "html": "*foo
\n", "example": 443, - "start_line": 7136, - "end_line": 7140, + "start_line": 7156, + "end_line": 7160, "section": "Emphasis and strong emphasis" }, { "markdown": "****foo*\n", "html": "***foo
\n", "example": 444, - "start_line": 7143, - "end_line": 7147, + "start_line": 7163, + "end_line": 7167, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo***\n", "html": "foo*
\n", "example": 445, - "start_line": 7150, - "end_line": 7154, + "start_line": 7170, + "end_line": 7174, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo****\n", "html": "foo***
\n", "example": 446, - "start_line": 7157, - "end_line": 7161, + "start_line": 7177, + "end_line": 7181, "section": "Emphasis and strong emphasis" }, { "markdown": "foo ___\n", "html": "foo ___
\n", "example": 447, - "start_line": 7167, - "end_line": 7171, + "start_line": 7187, + "end_line": 7191, "section": "Emphasis and strong emphasis" }, { "markdown": "foo _\\__\n", "html": "foo _
\n", "example": 448, - "start_line": 7174, - "end_line": 7178, + "start_line": 7194, + "end_line": 7198, "section": "Emphasis and strong emphasis" }, { "markdown": "foo _*_\n", "html": "foo *
\n", "example": 449, - "start_line": 7181, - "end_line": 7185, + "start_line": 7201, + "end_line": 7205, "section": "Emphasis and strong emphasis" }, { "markdown": "foo _____\n", "html": "foo _____
\n", "example": 450, - "start_line": 7188, - "end_line": 7192, + "start_line": 7208, + "end_line": 7212, "section": "Emphasis and strong emphasis" }, { "markdown": "foo __\\___\n", "html": "foo _
\n", "example": 451, - "start_line": 7195, - "end_line": 7199, + "start_line": 7215, + "end_line": 7219, "section": "Emphasis and strong emphasis" }, { "markdown": "foo __*__\n", "html": "foo *
\n", "example": 452, - "start_line": 7202, - "end_line": 7206, + "start_line": 7222, + "end_line": 7226, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo_\n", "html": "_foo
\n", "example": 453, - "start_line": 7209, - "end_line": 7213, + "start_line": 7229, + "end_line": 7233, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo__\n", "html": "foo_
\n", "example": 454, - "start_line": 7220, - "end_line": 7224, + "start_line": 7240, + "end_line": 7244, "section": "Emphasis and strong emphasis" }, { "markdown": "___foo__\n", "html": "_foo
\n", "example": 455, - "start_line": 7227, - "end_line": 7231, + "start_line": 7247, + "end_line": 7251, "section": "Emphasis and strong emphasis" }, { "markdown": "____foo_\n", "html": "___foo
\n", "example": 456, - "start_line": 7234, - "end_line": 7238, + "start_line": 7254, + "end_line": 7258, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo___\n", "html": "foo_
\n", "example": 457, - "start_line": 7241, - "end_line": 7245, + "start_line": 7261, + "end_line": 7265, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo____\n", "html": "foo___
\n", "example": 458, - "start_line": 7248, - "end_line": 7252, + "start_line": 7268, + "end_line": 7272, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo**\n", "html": "foo
\n", "example": 459, - "start_line": 7258, - "end_line": 7262, + "start_line": 7278, + "end_line": 7282, "section": "Emphasis and strong emphasis" }, { "markdown": "*_foo_*\n", "html": "foo
\n", "example": 460, - "start_line": 7265, - "end_line": 7269, + "start_line": 7285, + "end_line": 7289, "section": "Emphasis and strong emphasis" }, { "markdown": "__foo__\n", "html": "foo
\n", "example": 461, - "start_line": 7272, - "end_line": 7276, + "start_line": 7292, + "end_line": 7296, "section": "Emphasis and strong emphasis" }, { "markdown": "_*foo*_\n", "html": "foo
\n", "example": 462, - "start_line": 7279, - "end_line": 7283, + "start_line": 7299, + "end_line": 7303, "section": "Emphasis and strong emphasis" }, { "markdown": "****foo****\n", "html": "foo
\n", "example": 463, - "start_line": 7289, - "end_line": 7293, + "start_line": 7309, + "end_line": 7313, "section": "Emphasis and strong emphasis" }, { "markdown": "____foo____\n", "html": "foo
\n", "example": 464, - "start_line": 7296, - "end_line": 7300, + "start_line": 7316, + "end_line": 7320, "section": "Emphasis and strong emphasis" }, { "markdown": "******foo******\n", "html": "foo
\n", "example": 465, - "start_line": 7307, - "end_line": 7311, + "start_line": 7327, + "end_line": 7331, "section": "Emphasis and strong emphasis" }, { "markdown": "***foo***\n", "html": "foo
\n", "example": 466, - "start_line": 7316, - "end_line": 7320, + "start_line": 7336, + "end_line": 7340, "section": "Emphasis and strong emphasis" }, { "markdown": "_____foo_____\n", "html": "foo
\n", "example": 467, - "start_line": 7323, - "end_line": 7327, + "start_line": 7343, + "end_line": 7347, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo _bar* baz_\n", "html": "foo _bar baz_
\n", "example": 468, - "start_line": 7332, - "end_line": 7336, + "start_line": 7352, + "end_line": 7356, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo __bar *baz bim__ bam*\n", "html": "foo bar *baz bim bam
\n", "example": 469, - "start_line": 7339, - "end_line": 7343, + "start_line": 7359, + "end_line": 7363, "section": "Emphasis and strong emphasis" }, { "markdown": "**foo **bar baz**\n", "html": "**foo bar baz
\n", "example": 470, - "start_line": 7348, - "end_line": 7352, + "start_line": 7368, + "end_line": 7372, "section": "Emphasis and strong emphasis" }, { "markdown": "*foo *bar baz*\n", "html": "*foo bar baz
\n", "example": 471, - "start_line": 7355, - "end_line": 7359, + "start_line": 7375, + "end_line": 7379, "section": "Emphasis and strong emphasis" }, { "markdown": "*[bar*](/url)\n", "html": "*bar*
\n", "example": 472, - "start_line": 7364, - "end_line": 7368, + "start_line": 7384, + "end_line": 7388, "section": "Emphasis and strong emphasis" }, { "markdown": "_foo [bar_](/url)\n", "html": "_foo bar_
\n", "example": 473, - "start_line": 7371, - "end_line": 7375, + "start_line": 7391, + "end_line": 7395, "section": "Emphasis and strong emphasis" }, { "markdown": "**
a *
a _
[link](/my uri)
\n", - "example": 485, - "start_line": 7537, - "end_line": 7541, + "example": 487, + "start_line": 7574, + "end_line": 7578, "section": "Links" }, { "markdown": "[link]([link](foo\nbar)
\n", - "example": 487, - "start_line": 7552, - "end_line": 7558, + "example": 489, + "start_line": 7589, + "end_line": 7595, "section": "Links" }, { "markdown": "[link]([link](
[link](<foo>)
\n", - "example": 490, - "start_line": 7579, - "end_line": 7583, + "example": 492, + "start_line": 7616, + "end_line": 7620, "section": "Links" }, { "markdown": "[a](\n[a](c)\n", "html": "[a](<b)c\n[a](<b)c>\n[a](c)
\n", - "example": 491, - "start_line": 7588, - "end_line": 7596, + "example": 493, + "start_line": 7625, + "end_line": 7633, "section": "Links" }, { "markdown": "[link](\\(foo\\))\n", "html": "\n", - "example": 492, - "start_line": 7600, - "end_line": 7604, + "example": 494, + "start_line": 7637, + "end_line": 7641, "section": "Links" }, { "markdown": "[link](foo(and(bar)))\n", "html": "\n", - "example": 493, - "start_line": 7609, - "end_line": 7613, + "example": 495, + "start_line": 7646, + "end_line": 7650, "section": "Links" }, + { + "markdown": "[link](foo(and(bar))\n", + "html": "[link](foo(and(bar))
\n", + "example": 496, + "start_line": 7655, + "end_line": 7659, + "section": "Links", + "shouldFail": true + }, { "markdown": "[link](foo\\(and\\(bar\\))\n", "html": "\n", - "example": 494, - "start_line": 7618, - "end_line": 7622, + "example": 497, + "start_line": 7662, + "end_line": 7666, "section": "Links" }, { "markdown": "[link]([link](/url "title "and" title")
\n", - "example": 504, - "start_line": 7729, - "end_line": 7733, + "example": 507, + "start_line": 7774, + "end_line": 7778, "section": "Links" }, { "markdown": "[link](/url 'title \"and\" title')\n", "html": "\n", - "example": 505, - "start_line": 7738, - "end_line": 7742, + "example": 508, + "start_line": 7783, + "end_line": 7787, "section": "Links" }, { "markdown": "[link]( /uri\n \"title\" )\n", "html": "\n", - "example": 506, - "start_line": 7762, - "end_line": 7767, + "example": 509, + "start_line": 7808, + "end_line": 7813, "section": "Links" }, { "markdown": "[link] (/uri)\n", "html": "[link] (/uri)
\n", - "example": 507, - "start_line": 7773, - "end_line": 7777, + "example": 510, + "start_line": 7819, + "end_line": 7823, "section": "Links" }, { "markdown": "[link [foo [bar]]](/uri)\n", "html": "\n", - "example": 508, - "start_line": 7783, - "end_line": 7787, + "example": 511, + "start_line": 7829, + "end_line": 7833, "section": "Links", "shouldFail": true }, { "markdown": "[link] bar](/uri)\n", "html": "[link] bar](/uri)
\n", - "example": 509, - "start_line": 7790, - "end_line": 7794, + "example": 512, + "start_line": 7836, + "end_line": 7840, "section": "Links" }, { "markdown": "[link [bar](/uri)\n", "html": "[link bar
\n", - "example": 510, - "start_line": 7797, - "end_line": 7801, + "example": 513, + "start_line": 7843, + "end_line": 7847, "section": "Links" }, { "markdown": "[link \\[bar](/uri)\n", "html": "\n", - "example": 511, - "start_line": 7804, - "end_line": 7808, + "example": 514, + "start_line": 7850, + "end_line": 7854, "section": "Links" }, { "markdown": "[link *foo **bar** `#`*](/uri)\n", "html": "\n", - "example": 512, - "start_line": 7813, - "end_line": 7817, + "example": 515, + "start_line": 7859, + "end_line": 7863, "section": "Links" }, { "markdown": "[](/uri)\n", "html": "\n", - "example": 513, - "start_line": 7820, - "end_line": 7824, + "example": 516, + "start_line": 7866, + "end_line": 7870, "section": "Links" }, { "markdown": "[foo [bar](/uri)](/uri)\n", "html": "[foo bar](/uri)
\n", - "example": 514, - "start_line": 7829, - "end_line": 7833, + "example": 517, + "start_line": 7875, + "end_line": 7879, "section": "Links", "shouldFail": true }, { "markdown": "[foo *[bar [baz](/uri)](/uri)*](/uri)\n", "html": "[foo [bar baz](/uri)](/uri)
\n", - "example": 515, - "start_line": 7836, - "end_line": 7840, + "example": 518, + "start_line": 7882, + "end_line": 7886, "section": "Links", "shouldFail": true }, { "markdown": "](uri2)](uri3)\n", "html": "*foo*
\n", - "example": 517, - "start_line": 7853, - "end_line": 7857, + "example": 520, + "start_line": 7899, + "end_line": 7903, "section": "Links" }, { "markdown": "[foo *bar](baz*)\n", "html": "\n", - "example": 518, - "start_line": 7860, - "end_line": 7864, + "example": 521, + "start_line": 7906, + "end_line": 7910, "section": "Links" }, { "markdown": "*foo [bar* baz]\n", "html": "foo [bar baz]
\n", - "example": 519, - "start_line": 7870, - "end_line": 7874, + "example": 522, + "start_line": 7916, + "end_line": 7920, "section": "Links" }, { "markdown": "[foo[foo
[foo](/uri)
[foohttp://example.com/?search=](uri)
\n", - "example": 522, - "start_line": 7894, - "end_line": 7898, + "example": 525, + "start_line": 7940, + "end_line": 7944, "section": "Links", "shouldFail": true }, { "markdown": "[foo][bar]\n\n[bar]: /url \"title\"\n", "html": "\n", - "example": 523, - "start_line": 7932, - "end_line": 7938, + "example": 526, + "start_line": 7978, + "end_line": 7984, "section": "Links" }, { "markdown": "[link [foo [bar]]][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 524, - "start_line": 7947, - "end_line": 7953, + "example": 527, + "start_line": 7993, + "end_line": 7999, "section": "Links", "shouldFail": true }, { "markdown": "[link \\[bar][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 525, - "start_line": 7956, - "end_line": 7962, + "example": 528, + "start_line": 8002, + "end_line": 8008, "section": "Links" }, { "markdown": "[link *foo **bar** `#`*][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 526, - "start_line": 7967, - "end_line": 7973, + "example": 529, + "start_line": 8013, + "end_line": 8019, "section": "Links" }, { "markdown": "[][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 527, - "start_line": 7976, - "end_line": 7982, + "example": 530, + "start_line": 8022, + "end_line": 8028, "section": "Links" }, { "markdown": "[foo [bar](/uri)][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 528, - "start_line": 7987, - "end_line": 7993, + "example": 531, + "start_line": 8033, + "end_line": 8039, "section": "Links", "shouldFail": true }, { "markdown": "[foo *bar [baz][ref]*][ref]\n\n[ref]: /uri\n", "html": "\n", - "example": 529, - "start_line": 7996, - "end_line": 8002, + "example": 532, + "start_line": 8042, + "end_line": 8048, "section": "Links", "shouldFail": true }, { "markdown": "*[foo*][ref]\n\n[ref]: /uri\n", "html": "*foo*
\n", - "example": 530, - "start_line": 8011, - "end_line": 8017, + "example": 533, + "start_line": 8057, + "end_line": 8063, "section": "Links" }, { - "markdown": "[foo *bar][ref]\n\n[ref]: /uri\n", - "html": "\n", - "example": 531, - "start_line": 8020, - "end_line": 8026, + "markdown": "[foo *bar][ref]*\n\n[ref]: /uri\n", + "html": "\n", + "example": 534, + "start_line": 8066, + "end_line": 8072, "section": "Links" }, { "markdown": "[foo[foo
[foo][ref]
[foohttp://example.com/?search=][ref]
\n", - "example": 534, - "start_line": 8050, - "end_line": 8056, + "example": 537, + "start_line": 8096, + "end_line": 8102, "section": "Links", "shouldFail": true }, { "markdown": "[foo][BaR]\n\n[bar]: /url \"title\"\n", "html": "\n", - "example": 535, - "start_line": 8061, - "end_line": 8067, + "example": 538, + "start_line": 8107, + "end_line": 8113, "section": "Links" }, { - "markdown": "[Толпой][Толпой] is a Russian word.\n\n[ТОЛПОЙ]: /url\n", - "html": "Толпой is a Russian word.
\n", - "example": 536, - "start_line": 8072, - "end_line": 8078, - "section": "Links" + "markdown": "[ẞ]\n\n[SS]: /url\n", + "html": "\n", + "example": 539, + "start_line": 8118, + "end_line": 8124, + "section": "Links", + "shouldFail": true }, { "markdown": "[Foo\n bar]: /url\n\n[Baz][Foo bar]\n", "html": "\n", - "example": 537, - "start_line": 8084, - "end_line": 8091, + "example": 540, + "start_line": 8130, + "end_line": 8137, "section": "Links" }, { "markdown": "[foo] [bar]\n\n[bar]: /url \"title\"\n", "html": "[foo] bar
\n", - "example": 538, - "start_line": 8097, - "end_line": 8103, + "example": 541, + "start_line": 8143, + "end_line": 8149, "section": "Links" }, { "markdown": "[foo]\n[bar]\n\n[bar]: /url \"title\"\n", "html": "[foo]\nbar
\n", - "example": 539, - "start_line": 8106, - "end_line": 8114, + "example": 542, + "start_line": 8152, + "end_line": 8160, "section": "Links" }, { "markdown": "[foo]: /url1\n\n[foo]: /url2\n\n[bar][foo]\n", "html": "\n", - "example": 540, - "start_line": 8147, - "end_line": 8155, + "example": 543, + "start_line": 8193, + "end_line": 8201, "section": "Links" }, { "markdown": "[bar][foo\\!]\n\n[foo!]: /url\n", "html": "[bar][foo!]
\n", - "example": 541, - "start_line": 8162, - "end_line": 8168, + "example": 544, + "start_line": 8208, + "end_line": 8214, "section": "Links" }, { "markdown": "[foo][ref[]\n\n[ref[]: /uri\n", "html": "[foo][ref[]
\n[ref[]: /uri
\n", - "example": 542, - "start_line": 8174, - "end_line": 8181, + "example": 545, + "start_line": 8220, + "end_line": 8227, "section": "Links" }, { "markdown": "[foo][ref[bar]]\n\n[ref[bar]]: /uri\n", "html": "[foo][ref[bar]]
\n[ref[bar]]: /uri
\n", - "example": 543, - "start_line": 8184, - "end_line": 8191, + "example": 546, + "start_line": 8230, + "end_line": 8237, "section": "Links" }, { "markdown": "[[[foo]]]\n\n[[[foo]]]: /url\n", "html": "[[[foo]]]
\n[[[foo]]]: /url
\n", - "example": 544, - "start_line": 8194, - "end_line": 8201, + "example": 547, + "start_line": 8240, + "end_line": 8247, "section": "Links" }, { "markdown": "[foo][ref\\[]\n\n[ref\\[]: /uri\n", "html": "\n", - "example": 545, - "start_line": 8204, - "end_line": 8210, + "example": 548, + "start_line": 8250, + "end_line": 8256, "section": "Links" }, { "markdown": "[bar\\\\]: /uri\n\n[bar\\\\]\n", "html": "\n", - "example": 546, - "start_line": 8215, - "end_line": 8221, + "example": 549, + "start_line": 8261, + "end_line": 8267, "section": "Links" }, { "markdown": "[]\n\n[]: /uri\n", "html": "[]
\n[]: /uri
\n", - "example": 547, - "start_line": 8226, - "end_line": 8233, + "example": 550, + "start_line": 8273, + "end_line": 8280, "section": "Links" }, { "markdown": "[\n ]\n\n[\n ]: /uri\n", "html": "[\n]
\n[\n]: /uri
\n", - "example": 548, - "start_line": 8236, - "end_line": 8247, + "example": 551, + "start_line": 8283, + "end_line": 8294, "section": "Links" }, { "markdown": "[foo][]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 549, - "start_line": 8259, - "end_line": 8265, + "example": 552, + "start_line": 8306, + "end_line": 8312, "section": "Links" }, { "markdown": "[*foo* bar][]\n\n[*foo* bar]: /url \"title\"\n", "html": "\n", - "example": 550, - "start_line": 8268, - "end_line": 8274, + "example": 553, + "start_line": 8315, + "end_line": 8321, "section": "Links" }, { "markdown": "[Foo][]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 551, - "start_line": 8279, - "end_line": 8285, + "example": 554, + "start_line": 8326, + "end_line": 8332, "section": "Links" }, { "markdown": "[foo] \n[]\n\n[foo]: /url \"title\"\n", "html": "foo\n[]
\n", - "example": 552, - "start_line": 8292, - "end_line": 8300, + "example": 555, + "start_line": 8339, + "end_line": 8347, "section": "Links" }, { "markdown": "[foo]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 553, - "start_line": 8312, - "end_line": 8318, + "example": 556, + "start_line": 8359, + "end_line": 8365, "section": "Links" }, { "markdown": "[*foo* bar]\n\n[*foo* bar]: /url \"title\"\n", "html": "\n", - "example": 554, - "start_line": 8321, - "end_line": 8327, + "example": 557, + "start_line": 8368, + "end_line": 8374, "section": "Links" }, { "markdown": "[[*foo* bar]]\n\n[*foo* bar]: /url \"title\"\n", "html": "[foo bar]
\n", - "example": 555, - "start_line": 8330, - "end_line": 8336, + "example": 558, + "start_line": 8377, + "end_line": 8383, "section": "Links" }, { "markdown": "[[bar [foo]\n\n[foo]: /url\n", "html": "[[bar foo
\n", - "example": 556, - "start_line": 8339, - "end_line": 8345, + "example": 559, + "start_line": 8386, + "end_line": 8392, "section": "Links" }, { "markdown": "[Foo]\n\n[foo]: /url \"title\"\n", "html": "\n", - "example": 557, - "start_line": 8350, - "end_line": 8356, + "example": 560, + "start_line": 8397, + "end_line": 8403, "section": "Links" }, { "markdown": "[foo] bar\n\n[foo]: /url\n", "html": "foo bar
\n", - "example": 558, - "start_line": 8361, - "end_line": 8367, + "example": 561, + "start_line": 8408, + "end_line": 8414, "section": "Links" }, { "markdown": "\\[foo]\n\n[foo]: /url \"title\"\n", "html": "[foo]
\n", - "example": 559, - "start_line": 8373, - "end_line": 8379, + "example": 562, + "start_line": 8420, + "end_line": 8426, "section": "Links" }, { "markdown": "[foo*]: /url\n\n*[foo*]\n", "html": "*foo*
\n", - "example": 560, - "start_line": 8385, - "end_line": 8391, + "example": 563, + "start_line": 8432, + "end_line": 8438, "section": "Links" }, { "markdown": "[foo][bar]\n\n[foo]: /url1\n[bar]: /url2\n", "html": "\n", - "example": 561, - "start_line": 8397, - "end_line": 8404, + "example": 564, + "start_line": 8444, + "end_line": 8451, "section": "Links" }, { "markdown": "[foo][]\n\n[foo]: /url1\n", "html": "\n", - "example": 562, - "start_line": 8406, - "end_line": 8412, + "example": 565, + "start_line": 8453, + "end_line": 8459, "section": "Links" }, { "markdown": "[foo]()\n\n[foo]: /url1\n", "html": "\n", - "example": 563, - "start_line": 8416, - "end_line": 8422, + "example": 566, + "start_line": 8463, + "end_line": 8469, "section": "Links" }, { "markdown": "[foo](not a link)\n\n[foo]: /url1\n", "html": "foo(not a link)
\n", - "example": 564, - "start_line": 8424, - "end_line": 8430, + "example": 567, + "start_line": 8471, + "end_line": 8477, "section": "Links" }, { "markdown": "[foo][bar][baz]\n\n[baz]: /url\n", "html": "[foo]bar
\n", - "example": 565, - "start_line": 8435, - "end_line": 8441, + "example": 568, + "start_line": 8482, + "end_line": 8488, "section": "Links" }, { "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[bar]: /url2\n", "html": "\n", - "example": 566, - "start_line": 8447, - "end_line": 8454, + "example": 569, + "start_line": 8494, + "end_line": 8501, "section": "Links" }, { "markdown": "[foo][bar][baz]\n\n[baz]: /url1\n[foo]: /url2\n", "html": "[foo]bar
\n", - "example": 567, - "start_line": 8460, - "end_line": 8467, + "example": 570, + "start_line": 8507, + "end_line": 8514, "section": "Links" }, { "markdown": "\n", "html": "My
\n[]
![[foo]]
\n[[foo]]: /url "title"
\n", - "example": 586, - "start_line": 8653, - "end_line": 8660, + "example": 589, + "start_line": 8700, + "end_line": 8707, "section": "Images" }, { "markdown": "![Foo]\n\n[foo]: /url \"title\"\n", "html": "![foo]
\n", - "example": 588, - "start_line": 8677, - "end_line": 8683, + "example": 591, + "start_line": 8724, + "end_line": 8730, "section": "Images" }, { "markdown": "\\![foo]\n\n[foo]: /url \"title\"\n", "html": "!foo
\n", - "example": 589, - "start_line": 8689, - "end_line": 8695, + "example": 592, + "start_line": 8736, + "end_line": 8742, "section": "Images" }, { "markdown": "http://foo.bar.baz/test?q=hello&id=22&boolean
\n", - "example": 591, - "start_line": 8729, - "end_line": 8733, + "example": 594, + "start_line": 8776, + "end_line": 8780, "section": "Autolinks" }, { "markdown": "<http://foo.bar/baz bim>
\n", - "example": 598, - "start_line": 8787, - "end_line": 8791, + "example": 601, + "start_line": 8834, + "end_line": 8838, "section": "Autolinks", "shouldFail": true }, { "markdown": "<foo+@bar.example.com>
\n", - "example": 602, - "start_line": 8834, - "end_line": 8838, + "example": 605, + "start_line": 8881, + "end_line": 8885, "section": "Autolinks" }, { "markdown": "<>\n", "html": "<>
\n", - "example": 603, - "start_line": 8843, - "end_line": 8847, + "example": 606, + "start_line": 8890, + "end_line": 8894, "section": "Autolinks" }, { "markdown": "< http://foo.bar >\n", "html": "< http://foo.bar >
\n", - "example": 604, - "start_line": 8850, - "end_line": 8854, + "example": 607, + "start_line": 8897, + "end_line": 8901, "section": "Autolinks", "shouldFail": true }, { "markdown": "<m:abc>
\n", - "example": 605, - "start_line": 8857, - "end_line": 8861, + "example": 608, + "start_line": 8904, + "end_line": 8908, "section": "Autolinks" }, { "markdown": "<foo.bar.baz>
\n", - "example": 606, - "start_line": 8864, - "end_line": 8868, + "example": 609, + "start_line": 8911, + "end_line": 8915, "section": "Autolinks" }, { "markdown": "http://example.com\n", "html": "http://example.com
\n", - "example": 607, - "start_line": 8871, - "end_line": 8875, + "example": 610, + "start_line": 8918, + "end_line": 8922, "section": "Autolinks", "shouldFail": true }, { "markdown": "foo@bar.example.com\n", "html": "foo@bar.example.com
\n", - "example": 608, - "start_line": 8878, - "end_line": 8882, + "example": 611, + "start_line": 8925, + "end_line": 8929, "section": "Autolinks", "shouldFail": true }, { "markdown": "Foo
<33> <__>
\n", - "example": 614, - "start_line": 9009, - "end_line": 9013, + "example": 617, + "start_line": 9055, + "end_line": 9059, "section": "Raw HTML" }, { "markdown": "\n", "html": "<a h*#ref="hi">
\n", - "example": 615, - "start_line": 9018, - "end_line": 9022, + "example": 618, + "start_line": 9064, + "end_line": 9068, "section": "Raw HTML" }, { "markdown": " \n", "html": "<a href="hi'> <a href=hi'>
\n", - "example": 616, - "start_line": 9027, - "end_line": 9031, + "example": 619, + "start_line": 9073, + "end_line": 9077, "section": "Raw HTML" }, { "markdown": "< a><\nfoo>< a><\nfoo><bar/ >\n<foo bar=baz\nbim!bop />
\n", - "example": 617, - "start_line": 9036, - "end_line": 9046, + "example": 620, + "start_line": 9082, + "end_line": 9092, "section": "Raw HTML" }, { "markdown": "\n", "html": "<a href='bar'title=title>
\n", - "example": 618, - "start_line": 9051, - "end_line": 9055, + "example": 621, + "start_line": 9097, + "end_line": 9101, "section": "Raw HTML" }, { "markdown": "</a href="foo">
\n", - "example": 620, - "start_line": 9069, - "end_line": 9073, + "example": 623, + "start_line": 9115, + "end_line": 9119, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "foo
\n", - "example": 621, - "start_line": 9078, - "end_line": 9084, + "example": 624, + "start_line": 9124, + "end_line": 9130, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "foo <!-- not a comment -- two hyphens -->
\n", - "example": 622, - "start_line": 9087, - "end_line": 9091, + "example": 625, + "start_line": 9133, + "end_line": 9137, "section": "Raw HTML", "shouldFail": true }, { "markdown": "foo foo -->\n\nfoo \n", "html": "foo <!--> foo -->
\nfoo <!-- foo--->
\n", - "example": 623, - "start_line": 9096, - "end_line": 9103, + "example": 626, + "start_line": 9142, + "end_line": 9149, "section": "Raw HTML", "shouldFail": true }, { "markdown": "foo \n", "html": "foo
\n", - "example": 624, - "start_line": 9108, - "end_line": 9112, + "example": 627, + "start_line": 9154, + "end_line": 9158, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "foo
\n", - "example": 625, - "start_line": 9117, - "end_line": 9121, + "example": 628, + "start_line": 9163, + "end_line": 9167, "section": "Raw HTML" }, { "markdown": "foo &<]]>\n", "html": "foo &<]]>
\n", - "example": 626, - "start_line": 9126, - "end_line": 9130, + "example": 629, + "start_line": 9172, + "end_line": 9176, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "\n", - "example": 627, - "start_line": 9136, - "end_line": 9140, + "example": 630, + "start_line": 9182, + "end_line": 9186, "section": "Raw HTML" }, { "markdown": "foo \n", "html": "\n", - "example": 628, - "start_line": 9145, - "end_line": 9149, + "example": 631, + "start_line": 9191, + "end_line": 9195, "section": "Raw HTML" }, { "markdown": "\n", "html": "<a href=""">
\n", - "example": 629, - "start_line": 9152, - "end_line": 9156, + "example": 632, + "start_line": 9198, + "end_line": 9202, "section": "Raw HTML" }, { "markdown": "foo \nbaz\n", "html": "foo
\nbaz
foo
\nbaz
foo
\nbaz
foo
\nbar
foo
\nbar
foo
\nbar
foo
\nbar
code span
code span
code\\ span
foo\\
\n", - "example": 641, - "start_line": 9281, - "end_line": 9285, + "example": 644, + "start_line": 9327, + "end_line": 9331, "section": "Hard line breaks" }, { "markdown": "foo \n", "html": "foo
\n", - "example": 642, - "start_line": 9288, - "end_line": 9292, + "example": 645, + "start_line": 9334, + "end_line": 9338, "section": "Hard line breaks" }, { "markdown": "### foo\\\n", "html": "foo\nbaz
\n", - "example": 645, - "start_line": 9317, - "end_line": 9323, + "example": 648, + "start_line": 9363, + "end_line": 9369, "section": "Soft line breaks" }, { "markdown": "foo \n baz\n", "html": "foo\nbaz
\n", - "example": 646, - "start_line": 9329, - "end_line": 9335, + "example": 649, + "start_line": 9375, + "end_line": 9381, "section": "Soft line breaks" }, { "markdown": "hello $.;'there\n", "html": "hello $.;'there
\n", - "example": 647, - "start_line": 9349, - "end_line": 9353, + "example": 650, + "start_line": 9395, + "end_line": 9399, "section": "Textual content" }, { "markdown": "Foo χρῆν\n", "html": "Foo χρῆν
\n", - "example": 648, - "start_line": 9356, - "end_line": 9360, + "example": 651, + "start_line": 9402, + "end_line": 9406, "section": "Textual content" }, { "markdown": "Multiple spaces\n", "html": "Multiple spaces
\n", - "example": 649, - "start_line": 9365, - "end_line": 9369, + "example": 652, + "start_line": 9411, + "end_line": 9415, "section": "Textual content" } ] diff --git a/test/specs/gfm/gfm.0.29.json b/test/specs/gfm/gfm.0.29.json index 84bde40a28..50c4ac8d09 100644 --- a/test/specs/gfm/gfm.0.29.json +++ b/test/specs/gfm/gfm.0.29.json @@ -115,8 +115,8 @@ }, { "section": "[extension] Autolinks", - "html": "\n(Visit https://encrypted.google.com/search?q=Markup+(business))
\nAnonymous FTP is available at ftp://foo.bar.baz.
", - "markdown": "http://commonmark.org\n\n(Visit https://encrypted.google.com/search?q=Markup+(business))\n\nAnonymous FTP is available at ftp://foo.bar.baz.", + "html": "\n(Visit https://encrypted.google.com/search?q=Markup+(business))
", + "markdown": "http://commonmark.org\n\n(Visit https://encrypted.google.com/search?q=Markup+(business))", "example": 628 }, { From a90848f4dbd54a4b913af05cc6b5a963f0d64cb4 Mon Sep 17 00:00:00 2001 From: MarkedJS bot <> Date: Fri, 25 Jun 2021 20:15:30 +0000 Subject: [PATCH 034/208] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20build=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/marked.esm.js | 12 ++++++------ lib/marked.js | 12 ++++++------ marked.min.js | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/marked.esm.js b/lib/marked.esm.js index d6bd317891..40d25560da 100644 --- a/lib/marked.esm.js +++ b/lib/marked.esm.js @@ -1057,14 +1057,14 @@ const block$1 = { blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/, html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + '|comment[^\\n]*(\\n+|$)' // (2) + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) + '|\\n*|$)' // (4) + '|\\n*|$)' // (5) + '|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag + + '|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, nptable: noopTest, @@ -1119,7 +1119,7 @@ block$1.paragraph = edit(block$1._paragraph) .replace('blockquote', ' {0,3}>') .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)') + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)') .replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks .getRegex(); @@ -1153,7 +1153,7 @@ block$1.gfm.nptable = edit(block$1.gfm.nptable) .replace('code', ' {4}[^\\n]') .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)') + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)') .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks .getRegex(); @@ -1164,7 +1164,7 @@ block$1.gfm.table = edit(block$1.gfm.table) .replace('code', ' {4}[^\\n]') .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)') + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)') .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks .getRegex(); diff --git a/lib/marked.js b/lib/marked.js index 4f068e801c..10fe5d2815 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1166,14 +1166,14 @@ blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/, html: '^ {0,3}(?:' // optional indentation - + '<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + '|comment[^\\n]*(\\n+|$)' // (2) + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) + '|\\n*|$)' // (4) + '|\\n*|$)' // (5) + '|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) - + '|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag - + '|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag + + '|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, nptable: noopTest, @@ -1197,7 +1197,7 @@ block$1.html = edit(block$1.html, 'i').replace('comment', block$1._comment).replace('tag', block$1._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); block$1.paragraph = edit(block$1._paragraph).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)').replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks .getRegex(); block$1.blockquote = edit(block$1.blockquote).replace('paragraph', block$1.paragraph).getRegex(); /** @@ -1220,10 +1220,10 @@ }); block$1.gfm.nptable = edit(block$1.gfm.nptable).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks .getRegex(); block$1.gfm.table = edit(block$1.gfm.table).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks .getRegex(); /** * Pedantic grammar (original John Gruber's loose markdown specification) diff --git a/marked.min.js b/marked.min.js index d7c0bedc7a..92eccfd37f 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u'+(u?e:H(e,!0))+"
\n":""+(u?e:H(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u
'+(u?e:H(e,!0))+"
\n":""+(u?e:H(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file From 3a81bde4eb21f2eef432d4bf2ca9b2d58ef0ccf4 Mon Sep 17 00:00:00 2001 From: semantic-release-bot
**escape**(*string* src)
-- **tag**(*string* src, *bool* inLink, *bool* inRawBlock)
+- **tag**(*string* src)
- **link**(*string* src)
- **reflink**(*string* src, *object* links)
- **emStrong**(*string* src, *string* maskedSrc, *string* prevChar)
@@ -235,7 +235,7 @@ console.log(marked('$ latex code $\n\n` other code `'));
- **del**(*string* src)
- **autolink**(*string* src, *function* mangle)
- **url**(*string* src, *function* mangle)
-- **inlineText**(*string* src, *bool* inRawBlock, *function* smartypants)
+- **inlineText**(*string* src, *function* smartypants)
`mangle` is a method that changes text to HTML character references:
@@ -331,11 +331,15 @@ The returned token can also contain any other custom parameters of your choice t
The tokenizer function has access to the lexer in the `this` object, which can be used if any internal section of the string needs to be parsed further, such as in handling any inline syntax on the text within a block token. The key functions that may be useful include:
this.blockTokens(string text)
this.lexer.blockTokens(string text, array tokens)
tokens
array. The tokens
array is also returned by the function. You might use this, for example, if your extension creates a "container"-type token (such as a blockquote) that can potentially include other block-level tokens inside.this.inlineTokens(string text)
tokens
parameter.this.lexer.inline(string text, array tokens)
text
and tokens
to a queue to be processed using inline-level tokenizers (including any inline-level extensions) at that later step. Tokens will be generated using the provided text
, and any resulting tokens will be appended to the tokens
array. Note that this function does **NOT** return anything since the inline processing cannot happen until the block-level processing is complete.this.lexer.inlineTokens(string text, array tokens)
**strong**
token inside of a ### Heading
). This runs the inline tokenizer functions (including any inline-level extensions) on the provided text, and appends any resulting tokens onto the tokens
array. The tokens
array is also returned by the function.renderer(object token)
this.parse(array tokens)
this.parser.parse(array tokens)
this.parseInline(array tokens)
this.parser.parseInline(array tokens)
1 | 2 |
---|---|
1|\ | 2|\ |
1 | 2 |
---|---|
2 |
1 | 2 |
---|---|
2 |
1 | 2 |
---|---|
1 | 2| |
'
- + (escaped ? code : escape$1(code, true))
+ + (escaped ? code : escape$2(code, true))
+ '
\n';
}
return ''
- + (escaped ? code : escape$1(code, true))
+ + (escaped ? code : escape$2(code, true))
+ '
\n';
}
@@ -2037,11 +1992,11 @@ var Renderer_1 = class Renderer {
}
link(href, title, text) {
- href = cleanUrl(this.options.sanitize, this.options.baseUrl, href);
+ href = cleanUrl$1(this.options.sanitize, this.options.baseUrl, href);
if (href === null) {
return text;
}
- let out = ' 0 && item.tokens[0].type === 'text') {
+ if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') {
item.tokens[0].text = checkbox + ' ' + item.tokens[0].text;
if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') {
item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text;
@@ -2387,7 +2337,7 @@ var Parser_1 = class Parser {
// Run any renderer extensions
if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[token.type]) {
- ret = this.options.extensions.renderers[token.type].call(this, token);
+ ret = this.options.extensions.renderers[token.type].call({ parser: this }, token);
if (ret !== false || !['escape', 'html', 'link', 'image', 'strong', 'em', 'codespan', 'br', 'del', 'text'].includes(token.type)) {
out += ret || '';
continue;
@@ -2450,22 +2400,16 @@ var Parser_1 = class Parser {
}
};
-const Lexer = Lexer_1;
-const Parser = Parser_1;
-const Tokenizer = Tokenizer_1;
-const Renderer = Renderer_1;
-const TextRenderer = TextRenderer_1;
-const Slugger = Slugger_1;
const {
- merge,
- checkSanitizeDeprecation,
- escape
+ merge: merge$2,
+ checkSanitizeDeprecation: checkSanitizeDeprecation$1,
+ escape: escape$3
} = helpers;
const {
getDefaults,
changeDefaults,
- defaults
-} = defaults$5.exports;
+ defaults: defaults$5
+} = defaults;
/**
* Marked
@@ -2485,15 +2429,15 @@ function marked(src, opt, callback) {
opt = null;
}
- opt = merge({}, marked.defaults, opt || {});
- checkSanitizeDeprecation(opt);
+ opt = merge$2({}, marked.defaults, opt || {});
+ checkSanitizeDeprecation$1(opt);
if (callback) {
const highlight = opt.highlight;
let tokens;
try {
- tokens = Lexer.lex(src, opt);
+ tokens = Lexer_1.lex(src, opt);
} catch (e) {
return callback(e);
}
@@ -2506,7 +2450,7 @@ function marked(src, opt, callback) {
if (opt.walkTokens) {
marked.walkTokens(tokens, opt.walkTokens);
}
- out = Parser.parse(tokens, opt);
+ out = Parser_1.parse(tokens, opt);
} catch (e) {
err = e;
}
@@ -2558,16 +2502,16 @@ function marked(src, opt, callback) {
}
try {
- const tokens = Lexer.lex(src, opt);
+ const tokens = Lexer_1.lex(src, opt);
if (opt.walkTokens) {
marked.walkTokens(tokens, opt.walkTokens);
}
- return Parser.parse(tokens, opt);
+ return Parser_1.parse(tokens, opt);
} catch (e) {
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
if (opt.silent) {
return 'An error occurred:
' - + escape(e.message + '', true) + + escape$3(e.message + '', true) + ''; } throw e; @@ -2580,21 +2524,21 @@ function marked(src, opt, callback) { marked.options = marked.setOptions = function(opt) { - merge(marked.defaults, opt); + merge$2(marked.defaults, opt); changeDefaults(marked.defaults); return marked; }; marked.getDefaults = getDefaults; -marked.defaults = defaults; +marked.defaults = defaults$5; /** * Use Extension */ marked.use = function(...args) { - const opts = merge({}, ...args); + const opts = merge$2({}, ...args); const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} }; let hasExtensions; @@ -2654,7 +2598,7 @@ marked.use = function(...args) { // ==-- Parse "overwrite" extensions --== // if (pack.renderer) { - const renderer = marked.defaults.renderer || new Renderer(); + const renderer = marked.defaults.renderer || new Renderer_1(); for (const prop in pack.renderer) { const prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false @@ -2669,7 +2613,7 @@ marked.use = function(...args) { opts.renderer = renderer; } if (pack.tokenizer) { - const tokenizer = marked.defaults.tokenizer || new Tokenizer(); + const tokenizer = marked.defaults.tokenizer || new Tokenizer_1(); for (const prop in pack.tokenizer) { const prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false @@ -2752,20 +2696,20 @@ marked.parseInline = function(src, opt) { + Object.prototype.toString.call(src) + ', string expected'); } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); + opt = merge$2({}, marked.defaults, opt || {}); + checkSanitizeDeprecation$1(opt); try { - const tokens = Lexer.lexInline(src, opt); + const tokens = Lexer_1.lexInline(src, opt); if (opt.walkTokens) { marked.walkTokens(tokens, opt.walkTokens); } - return Parser.parseInline(tokens, opt); + return Parser_1.parseInline(tokens, opt); } catch (e) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if (opt.silent) { return '
An error occurred:
' - + escape(e.message + '', true) + + escape$3(e.message + '', true) + ''; } throw e; @@ -2776,18 +2720,18 @@ marked.parseInline = function(src, opt) { * Expose */ -marked.Parser = Parser; -marked.parser = Parser.parse; +marked.Parser = Parser_1; +marked.parser = Parser_1.parse; -marked.Renderer = Renderer; -marked.TextRenderer = TextRenderer; +marked.Renderer = Renderer_1; +marked.TextRenderer = TextRenderer_1; -marked.Lexer = Lexer; -marked.lexer = Lexer.lex; +marked.Lexer = Lexer_1; +marked.lexer = Lexer_1.lex; -marked.Tokenizer = Tokenizer; +marked.Tokenizer = Tokenizer_1; -marked.Slugger = Slugger; +marked.Slugger = Slugger_1; marked.parse = marked; diff --git a/lib/marked.js b/lib/marked.js index 10fe5d2815..8f43b0b880 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -49,61 +49,70 @@ } function _createForOfIteratorHelperLoose(o, allowArrayLike) { - var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; - if (it) return (it = it.call(o)).next.bind(it); - - if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { - if (it) o = it; - var i = 0; - return function () { - if (i >= o.length) return { - done: true - }; - return { - done: false, - value: o[i++] + var it; + + if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; }; - }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + it = o[Symbol.iterator](); + return it.next.bind(it); } - var defaults$5 = {exports: {}}; - - function getDefaults$1() { - return { - baseUrl: null, - breaks: false, - extensions: null, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'language-', - mangle: true, - pedantic: false, - renderer: null, - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tokenizer: null, - walkTokens: null, - xhtml: false - }; + function createCommonjsModule(fn) { + var module = { exports: {} }; + return fn(module, module.exports), module.exports; } - function changeDefaults$1(newDefaults) { - defaults$5.exports.defaults = newDefaults; - } + var defaults = createCommonjsModule(function (module) { + function getDefaults() { + return { + baseUrl: null, + breaks: false, + extensions: null, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'language-', + mangle: true, + pedantic: false, + renderer: null, + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tokenizer: null, + walkTokens: null, + xhtml: false + }; + } - defaults$5.exports = { - defaults: getDefaults$1(), - getDefaults: getDefaults$1, - changeDefaults: changeDefaults$1 - }; + function changeDefaults(newDefaults) { + module.exports.defaults = newDefaults; + } + + module.exports = { + defaults: getDefaults(), + getDefaults: getDefaults, + changeDefaults: changeDefaults + }; + }); /** * Helpers @@ -124,7 +133,7 @@ return escapeReplacements[ch]; }; - function escape$2(html, encode) { + function escape(html, encode) { if (encode) { if (escapeTest.test(html)) { return html.replace(escapeReplace, getEscapeReplacement); @@ -140,7 +149,7 @@ var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; - function unescape$1(html) { + function unescape(html) { // explicitly match decimal, hex, and named HTML entities return html.replace(unescapeTest, function (_, n) { n = n.toLowerCase(); @@ -156,7 +165,7 @@ var caret = /(^|[^\[])\^/g; - function edit$1(regex, opt) { + function edit(regex, opt) { regex = regex.source || regex; opt = opt || ''; var obj = { @@ -176,12 +185,12 @@ var nonWordAndColonTest = /[^\w:]/g; var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; - function cleanUrl$1(sanitize, base, href) { + function cleanUrl(sanitize, base, href) { if (sanitize) { var prot; try { - prot = decodeURIComponent(unescape$1(href)).replace(nonWordAndColonTest, '').toLowerCase(); + prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase(); } catch (e) { return null; } @@ -217,7 +226,7 @@ if (justDomain.test(base)) { baseUrls[' ' + base] = base + '/'; } else { - baseUrls[' ' + base] = rtrim$1(base, '/', true); + baseUrls[' ' + base] = rtrim(base, '/', true); } } @@ -241,11 +250,11 @@ } } - var noopTest$1 = { + var noopTest = { exec: function noopTest() {} }; - function merge$2(obj) { + function merge(obj) { var i = 1, target, key; @@ -263,7 +272,7 @@ return obj; } - function splitCells$1(tableRow, count) { + function splitCells(tableRow, count) { // ensure that every cell-delimiting pipe has a space // before it to distinguish it from an escaped pipe var row = tableRow.replace(/\|/g, function (match, offset, str) { @@ -284,7 +293,15 @@ } }), cells = row.split(/ \|/); - var i = 0; + var i = 0; // First/last cell in a row cannot be empty if it has no leading/trailing pipe + + if (!cells[0].trim()) { + cells.shift(); + } + + if (!cells[cells.length - 1].trim()) { + cells.pop(); + } if (cells.length > count) { cells.splice(count); @@ -305,7 +322,7 @@ // invert: Remove suffix of non-c chars instead. Default falsey. - function rtrim$1(str, c, invert) { + function rtrim(str, c, invert) { var l = str.length; if (l === 0) { @@ -330,7 +347,7 @@ return str.substr(0, l - suffLen); } - function findClosingBracket$1(str, b) { + function findClosingBracket(str, b) { if (str.indexOf(b[1]) === -1) { return -1; } @@ -356,14 +373,14 @@ return -1; } - function checkSanitizeDeprecation$1(opt) { + function checkSanitizeDeprecation(opt) { if (opt && opt.sanitize && !opt.silent) { console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); } } // copied from https://stackoverflow.com/a/5450113/806777 - function repeatString$1(pattern, count) { + function repeatString(pattern, count) { if (count < 1) { return ''; } @@ -383,38 +400,40 @@ } var helpers = { - escape: escape$2, - unescape: unescape$1, - edit: edit$1, - cleanUrl: cleanUrl$1, + escape: escape, + unescape: unescape, + edit: edit, + cleanUrl: cleanUrl, resolveUrl: resolveUrl, - noopTest: noopTest$1, - merge: merge$2, - splitCells: splitCells$1, - rtrim: rtrim$1, - findClosingBracket: findClosingBracket$1, - checkSanitizeDeprecation: checkSanitizeDeprecation$1, - repeatString: repeatString$1 + noopTest: noopTest, + merge: merge, + splitCells: splitCells, + rtrim: rtrim, + findClosingBracket: findClosingBracket, + checkSanitizeDeprecation: checkSanitizeDeprecation, + repeatString: repeatString }; - var defaults$4 = defaults$5.exports.defaults; - var rtrim = helpers.rtrim, - splitCells = helpers.splitCells, + var defaults$1 = defaults.defaults; + var rtrim$1 = helpers.rtrim, + splitCells$1 = helpers.splitCells, _escape = helpers.escape, - findClosingBracket = helpers.findClosingBracket; + findClosingBracket$1 = helpers.findClosingBracket; - function outputLink(cap, link, raw) { + function outputLink(cap, link, raw, lexer) { var href = link.href; var title = link.title ? _escape(link.title) : null; var text = cap[1].replace(/\\([\[\]])/g, '$1'); if (cap[0].charAt(0) !== '!') { + lexer.state.inLink = true; return { type: 'link', raw: raw, href: href, title: title, - text: text + text: text, + tokens: lexer.inlineTokens(text, []) }; } else { return { @@ -458,7 +477,7 @@ var Tokenizer_1 = /*#__PURE__*/function () { function Tokenizer(options) { - this.options = options || defaults$4; + this.options = options || defaults$1; } var _proto = Tokenizer.prototype; @@ -489,7 +508,7 @@ type: 'code', raw: cap[0], codeBlockStyle: 'indented', - text: !this.options.pedantic ? rtrim(text, '\n') : text + text: !this.options.pedantic ? rtrim$1(text, '\n') : text }; } }; @@ -516,7 +535,7 @@ var text = cap[2].trim(); // remove trailing #s if (/#$/.test(text)) { - var trimmed = rtrim(text, '#'); + var trimmed = rtrim$1(text, '#'); if (this.options.pedantic) { text = trimmed.trim(); @@ -526,51 +545,15 @@ } } - return { + var token = { type: 'heading', raw: cap[0], depth: cap[1].length, - text: text + text: text, + tokens: [] }; - } - }; - - _proto.nptable = function nptable(src) { - var cap = this.rules.block.nptable.exec(src); - - if (cap) { - var item = { - type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), - align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), - cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [], - raw: cap[0] - }; - - if (item.header.length === item.align.length) { - var l = item.align.length; - var i; - - for (i = 0; i < l; i++) { - if (/^ *-+: *$/.test(item.align[i])) { - item.align[i] = 'right'; - } else if (/^ *:-+: *$/.test(item.align[i])) { - item.align[i] = 'center'; - } else if (/^ *:-+ *$/.test(item.align[i])) { - item.align[i] = 'left'; - } else { - item.align[i] = null; - } - } - - l = item.cells.length; - - for (i = 0; i < l; i++) { - item.cells[i] = splitCells(item.cells[i], item.header.length); - } - - return item; - } + this.lexer.inline(token.text, token.tokens); + return token; } }; @@ -593,6 +576,7 @@ return { type: 'blockquote', raw: cap[0], + tokens: this.lexer.blockTokens(text, []), text: text }; } @@ -602,121 +586,150 @@ var cap = this.rules.block.list.exec(src); if (cap) { - var raw = cap[0]; - var bull = cap[2]; + var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, lines, itemContents; + var bull = cap[1].trim(); var isordered = bull.length > 1; var list = { type: 'list', - raw: raw, + raw: '', ordered: isordered, start: isordered ? +bull.slice(0, -1) : '', loose: false, items: [] - }; // Get each top-level item. - - var itemMatch = cap[0].match(this.rules.block.item); - var next = false, - item, - space, - bcurr, - bnext, - addBack, - loose, - istask, - ischecked, - endMatch; - var l = itemMatch.length; - bcurr = this.rules.block.listItemStart.exec(itemMatch[0]); - - for (var i = 0; i < l; i++) { - item = itemMatch[i]; - raw = item; - - if (!this.options.pedantic) { - // Determine if current item contains the end of the list - endMatch = item.match(new RegExp('\\n\\s*\\n {0,' + (bcurr[0].length - 1) + '}\\S')); - - if (endMatch) { - addBack = item.length - endMatch.index + itemMatch.slice(i + 1).join('\n').length; - list.raw = list.raw.substring(0, list.raw.length - addBack); - item = item.substring(0, endMatch.index); - raw = item; - l = i + 1; - } - } // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. + }; + bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull; + if (this.options.pedantic) { + bull = isordered ? bull : '[*+-]'; + } // Get next list item - if (i !== l - 1) { - bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]); - if (!this.options.pedantic ? bnext[1].length >= bcurr[0].length || bnext[1].length > 3 : bnext[1].length > bcurr[1].length) { - // nested list or continuation - itemMatch.splice(i, 2, itemMatch[i] + (!this.options.pedantic && bnext[1].length < bcurr[0].length && !itemMatch[i].match(/\n$/) ? '' : '\n') + itemMatch[i + 1]); - i--; - l--; - continue; - } else if ( // different bullet style - !this.options.pedantic || this.options.smartLists ? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1] : isordered === (bnext[2].length === 1)) { - addBack = itemMatch.slice(i + 1).join('\n').length; - list.raw = list.raw.substring(0, list.raw.length - addBack); - i = l - 1; - } + var itemRegex = new RegExp("^( {0,3}" + bull + ")((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))"); // Get each top-level item + + while (src) { + if (this.rules.block.hr.test(src)) { + // End list if we encounter an HR (possibly move into itemRegex?) + break; + } + + if (!(cap = itemRegex.exec(src))) { + break; + } + + lines = cap[2].split('\n'); + + if (this.options.pedantic) { + indent = 2; + itemContents = lines[0].trimLeft(); + } else { + indent = cap[2].search(/[^ ]/); // Find first non-space char + + indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1 + + itemContents = lines[0].slice(indent - cap[1].length); + } - bcurr = bnext; - } // Remove the list item's bullet - // so it is seen as the next token. + blankLine = false; + raw = cap[0]; + if (!lines[0] && /^ *$/.test(lines[1])) { + // items begin with at most one blank line + raw = cap[1] + lines.slice(0, 2).join('\n') + '\n'; + list.loose = true; + lines = []; + } - space = item.length; - item = item.replace(/^ *([*+-]|\d+[.)]) ?/, ''); // Outdent whatever the - // list item contains. Hacky. + var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])"); - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') : item.replace(/^ {1,4}/gm, ''); - } // trim item newlines at end + for (i = 1; i < lines.length; i++) { + line = lines[i]; + if (this.options.pedantic) { + // Re-align to follow commonmark nesting rules + line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); + } // End list item if found start of new bullet - item = rtrim(item, '\n'); - if (i !== l - 1) { - raw = raw + '\n'; - } // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. + if (nextBulletRegex.test(line)) { + raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; + break; + } // Until we encounter a blank line, item contents do not need indentation - loose = next || /\n\n(?!\s*$)/.test(raw); + if (!blankLine) { + if (!line.trim()) { + // Check if current line is empty + blankLine = true; + } // Dedent if possible - if (i !== l - 1) { - next = raw.slice(-2) === '\n\n'; - if (!loose) loose = next; + + if (line.search(/[^ ]/) >= indent) { + itemContents += '\n' + line.slice(indent); + } else { + itemContents += '\n' + line; + } + + continue; + } // Dedent this line + + + if (line.search(/[^ ]/) >= indent || !line.trim()) { + itemContents += '\n' + line.slice(indent); + continue; + } else { + // Line was not properly indented; end of this item + raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; + break; + } } - if (loose) { - list.loose = true; + if (!list.loose) { + // If the previous item ended with a blank line, the list is loose + if (endsWithBlankLine) { + list.loose = true; + } else if (/\n *\n *$/.test(raw)) { + endsWithBlankLine = true; + } } // Check for task list items if (this.options.gfm) { - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; + istask = /^\[[ xX]\] /.exec(itemContents); if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); + ischecked = istask[0] !== '[ ] '; + itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); } } list.items.push({ type: 'list_item', raw: raw, - task: istask, + task: !!istask, checked: ischecked, - loose: loose, - text: item + loose: false, + text: itemContents }); + list.raw += raw; + src = src.slice(raw.length); + } // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic + + + list.items[list.items.length - 1].raw = raw.trimRight(); + list.items[list.items.length - 1].text = itemContents.trimRight(); + list.raw = list.raw.trimRight(); + var l = list.items.length; // Item child tokens handled here at end because we needed to have the final item to trim it first + + for (i = 0; i < l; i++) { + this.lexer.state.top = false; + list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); + + if (list.items[i].tokens.some(function (t) { + return t.type === 'space'; + })) { + list.loose = true; + list.items[i].loose = true; + } } return list; @@ -727,12 +740,21 @@ var cap = this.rules.block.html.exec(src); if (cap) { - return { - type: this.options.sanitize ? 'paragraph' : 'html', + var token = { + type: 'html', raw: cap[0], pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), - text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0] + text: cap[0] }; + + if (this.options.sanitize) { + token.type = 'paragraph'; + token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]); + token.tokens = []; + this.lexer.inline(token.text, token.tokens); + } + + return token; } }; @@ -758,7 +780,7 @@ if (cap) { var item = { type: 'table', - header: splitCells(cap[1].replace(/^ *| *\| *$/g, '')), + header: splitCells$1(cap[1].replace(/^ *| *\| *$/g, '')), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] }; @@ -766,7 +788,7 @@ if (item.header.length === item.align.length) { item.raw = cap[0]; var l = item.align.length; - var i; + var i, j, k, row; for (i = 0; i < l; i++) { if (/^ *-+: *$/.test(item.align[i])) { @@ -783,7 +805,33 @@ l = item.cells.length; for (i = 0; i < l; i++) { - item.cells[i] = splitCells(item.cells[i].replace(/^ *\| *| *\| *$/g, ''), item.header.length); + item.cells[i] = splitCells$1(item.cells[i], item.header.length); + } // parse child tokens inside headers and cells + + + item.tokens = { + header: [], + cells: [] + }; // header child tokens + + l = item.header.length; + + for (j = 0; j < l; j++) { + item.tokens.header[j] = []; + this.lexer.inlineTokens(item.header[j], item.tokens.header[j]); + } // cell child tokens + + + l = item.cells.length; + + for (j = 0; j < l; j++) { + row = item.cells[j]; + item.tokens.cells[j] = []; + + for (k = 0; k < row.length; k++) { + item.tokens.cells[j][k] = []; + this.lexer.inlineTokens(row[k], item.tokens.cells[j][k]); + } } return item; @@ -795,12 +843,15 @@ var cap = this.rules.block.lheading.exec(src); if (cap) { - return { + var token = { type: 'heading', raw: cap[0], depth: cap[2].charAt(0) === '=' ? 1 : 2, - text: cap[1] + text: cap[1], + tokens: [] }; + this.lexer.inline(token.text, token.tokens); + return token; } }; @@ -808,11 +859,14 @@ var cap = this.rules.block.paragraph.exec(src); if (cap) { - return { + var token = { type: 'paragraph', raw: cap[0], - text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1] + text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1], + tokens: [] }; + this.lexer.inline(token.text, token.tokens); + return token; } }; @@ -820,11 +874,14 @@ var cap = this.rules.block.text.exec(src); if (cap) { - return { + var token = { type: 'text', raw: cap[0], - text: cap[0] + text: cap[0], + tokens: [] }; + this.lexer.inline(token.text, token.tokens); + return token; } }; @@ -840,27 +897,27 @@ } }; - _proto.tag = function tag(src, inLink, inRawBlock) { + _proto.tag = function tag(src) { var cap = this.rules.inline.tag.exec(src); if (cap) { - if (!inLink && /^/i.test(cap[0])) { - inLink = false; + if (!this.lexer.state.inLink && /^/i.test(cap[0])) { + this.lexer.state.inLink = false; } - if (!inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - inRawBlock = true; - } else if (inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { - inRawBlock = false; + if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = true; + } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = false; } return { type: this.options.sanitize ? 'text' : 'html', raw: cap[0], - inLink: inLink, - inRawBlock: inRawBlock, + inLink: this.lexer.state.inLink, + inRawBlock: this.lexer.state.inRawBlock, text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0] }; } @@ -879,14 +936,14 @@ } // ending angle bracket cannot be escaped - var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); + var rtrimSlash = rtrim$1(trimmedUrl.slice(0, -1), '\\'); if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { return; } } else { // find closing parenthesis - var lastParenIndex = findClosingBracket(cap[2], '()'); + var lastParenIndex = findClosingBracket$1(cap[2], '()'); if (lastParenIndex > -1) { var start = cap[0].indexOf('!') === 0 ? 5 : 4; @@ -926,7 +983,7 @@ return outputLink(cap, { href: href ? href.replace(this.rules.inline._escapes, '$1') : href, title: title ? title.replace(this.rules.inline._escapes, '$1') : title - }, cap[0]); + }, cap[0], this.lexer); } }; @@ -946,7 +1003,7 @@ }; } - return outputLink(cap, link, cap[0]); + return outputLink(cap, link, cap[0], this.lexer); } }; @@ -997,18 +1054,23 @@ rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); // Create `em` if smallest delimiter has odd char count. *a*** if (Math.min(lLength, rLength) % 2) { + var _text = src.slice(1, lLength + match.index + rLength); + return { type: 'em', raw: src.slice(0, lLength + match.index + rLength + 1), - text: src.slice(1, lLength + match.index + rLength) + text: _text, + tokens: this.lexer.inlineTokens(_text, []) }; } // Create 'strong' if smallest delimiter has even char count. **a*** + var text = src.slice(2, lLength + match.index + rLength - 1); return { type: 'strong', raw: src.slice(0, lLength + match.index + rLength + 1), - text: src.slice(2, lLength + match.index + rLength - 1) + text: text, + tokens: this.lexer.inlineTokens(text, []) }; } } @@ -1053,7 +1115,8 @@ return { type: 'del', raw: cap[0], - text: cap[2] + text: cap[2], + tokens: this.lexer.inlineTokens(cap[2], []) }; } }; @@ -1127,13 +1190,13 @@ } }; - _proto.inlineText = function inlineText(src, inRawBlock, smartypants) { + _proto.inlineText = function inlineText(src, smartypants) { var cap = this.rules.inline.text.exec(src); if (cap) { var text; - if (inRawBlock) { + if (this.lexer.state.inRawBlock) { text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0]; } else { text = _escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); @@ -1150,21 +1213,21 @@ return Tokenizer; }(); - var noopTest = helpers.noopTest, - edit = helpers.edit, + var noopTest$1 = helpers.noopTest, + edit$1 = helpers.edit, merge$1 = helpers.merge; /** * Block-Level Grammar */ - var block$1 = { + var block = { newline: /^(?: *(?:\n|$))+/, code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, + fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/, + list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/, html: '^ {0,3}(?:' // optional indentation + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + '|comment[^\\n]*(\\n+|$)' // (2) @@ -1176,76 +1239,66 @@ + '|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + ')', def: /^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, - nptable: noopTest, - table: noopTest, + table: noopTest$1, lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, // regex template, placeholders will be replaced according to different paragraph // interruption rules of commonmark and the original markdown spec: _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/, text: /^[^\n]+/ }; - block$1._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; - block$1._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; - block$1.def = edit(block$1.def).replace('label', block$1._label).replace('title', block$1._title).getRegex(); - block$1.bullet = /(?:[*+-]|\d{1,9}[.)])/; - block$1.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/; - block$1.item = edit(block$1.item, 'gm').replace(/bull/g, block$1.bullet).getRegex(); - block$1.listItemStart = edit(/^( *)(bull) */).replace('bull', block$1.bullet).getRegex(); - block$1.list = edit(block$1.list).replace(/bull/g, block$1.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block$1.def.source + ')').getRegex(); - block$1._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; - block$1._comment = /|$)/; - block$1.html = edit(block$1.html, 'i').replace('comment', block$1._comment).replace('tag', block$1._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); - block$1.paragraph = edit(block$1._paragraph).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs + block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; + block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; + block.def = edit$1(block.def).replace('label', block._label).replace('title', block._title).getRegex(); + block.bullet = /(?:[*+-]|\d{1,9}[.)])/; + block.listItemStart = edit$1(/^( *)(bull) */).replace('bull', block.bullet).getRegex(); + block.list = edit$1(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex(); + block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; + block._comment = /|$)/; + block.html = edit$1(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); + block.paragraph = edit$1(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks .getRegex(); - block$1.blockquote = edit(block$1.blockquote).replace('paragraph', block$1.paragraph).getRegex(); + block.blockquote = edit$1(block.blockquote).replace('paragraph', block.paragraph).getRegex(); /** * Normal Block Grammar */ - block$1.normal = merge$1({}, block$1); + block.normal = merge$1({}, block); /** * GFM Block Grammar */ - block$1.gfm = merge$1({}, block$1.normal, { - nptable: '^ *([^|\\n ].*\\|.*)\\n' // Header - + ' {0,3}([-:]+ *\\|[-| :]*)' // Align - + '(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)', - // Cells - table: '^ *\\|(.+)\\n' // Header - + ' {0,3}\\|?( *[-:]+[-| :]*)' // Align + block.gfm = merge$1({}, block.normal, { + table: '^ *([^\\n ].*\\|.*)\\n' // Header + + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?' // Align + '(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); - block$1.gfm.nptable = edit(block$1.gfm.nptable).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks - .getRegex(); - block$1.gfm.table = edit(block$1.gfm.table).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt - .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks + block.gfm.table = edit$1(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks .getRegex(); /** * Pedantic grammar (original John Gruber's loose markdown specification) */ - block$1.pedantic = merge$1({}, block$1.normal, { - html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)' // closed tag - + '|
An error occurred:
' + escape(e.message + '', true) + ''; + return '
An error occurred:
' + escape$2(e.message + '', true) + ''; } throw e; @@ -2700,13 +2676,13 @@ marked.options = marked.setOptions = function (opt) { - merge(marked.defaults, opt); + merge$2(marked.defaults, opt); changeDefaults(marked.defaults); return marked; }; marked.getDefaults = getDefaults; - marked.defaults = defaults; + marked.defaults = defaults$5; /** * Use Extension */ @@ -2718,7 +2694,7 @@ args[_key] = arguments[_key]; } - var opts = merge.apply(void 0, [{}].concat(args)); + var opts = merge$2.apply(void 0, [{}].concat(args)); var extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} @@ -2797,7 +2773,7 @@ if (pack.renderer) { (function () { - var renderer = marked.defaults.renderer || new Renderer(); + var renderer = marked.defaults.renderer || new Renderer_1(); var _loop = function _loop(prop) { var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false @@ -2827,7 +2803,7 @@ if (pack.tokenizer) { (function () { - var tokenizer = marked.defaults.tokenizer || new Tokenizer(); + var tokenizer = marked.defaults.tokenizer || new Tokenizer_1(); var _loop2 = function _loop2(prop) { var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false @@ -2944,22 +2920,22 @@ throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); } - opt = merge({}, marked.defaults, opt || {}); - checkSanitizeDeprecation(opt); + opt = merge$2({}, marked.defaults, opt || {}); + checkSanitizeDeprecation$1(opt); try { - var tokens = Lexer.lexInline(src, opt); + var tokens = Lexer_1.lexInline(src, opt); if (opt.walkTokens) { marked.walkTokens(tokens, opt.walkTokens); } - return Parser.parseInline(tokens, opt); + return Parser_1.parseInline(tokens, opt); } catch (e) { e.message += '\nPlease report this to https://github.com/markedjs/marked.'; if (opt.silent) { - return '
An error occurred:
' + escape(e.message + '', true) + ''; + return '
An error occurred:
' + escape$2(e.message + '', true) + ''; } throw e; @@ -2970,14 +2946,14 @@ */ - marked.Parser = Parser; - marked.parser = Parser.parse; - marked.Renderer = Renderer; - marked.TextRenderer = TextRenderer; - marked.Lexer = Lexer; - marked.lexer = Lexer.lex; - marked.Tokenizer = Tokenizer; - marked.Slugger = Slugger; + marked.Parser = Parser_1; + marked.parser = Parser_1.parse; + marked.Renderer = Renderer_1; + marked.TextRenderer = TextRenderer_1; + marked.Lexer = Lexer_1; + marked.lexer = Lexer_1.lex; + marked.Tokenizer = Tokenizer_1; + marked.Slugger = Slugger_1; marked.parse = marked; var marked_1 = marked; diff --git a/src/Lexer.js b/src/Lexer.js index c1d8b03cb4..d34aa47bc0 100644 --- a/src/Lexer.js +++ b/src/Lexer.js @@ -163,10 +163,9 @@ module.exports = class Lexer { src = src.substring(token.raw.length); lastToken = tokens[tokens.length - 1]; // An indented code block cannot interrupt a paragraph. - if (lastToken && lastToken.type === 'paragraph') { + if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { lastToken.raw += '\n' + token.raw; lastToken.text += '\n' + token.text; - this.inlineQueue.pop(); this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; } else { tokens.push(token); @@ -217,9 +216,14 @@ module.exports = class Lexer { } // def - if (this.state.top && (token = this.tokenizer.def(src))) { + if (token = this.tokenizer.def(src)) { src = src.substring(token.raw.length); - if (!this.tokens.links[token.tag]) { + lastToken = tokens[tokens.length - 1]; + if (lastToken && (lastToken.type === 'paragraph' || lastToken.type === 'text')) { + lastToken.raw += '\n' + token.raw; + lastToken.text += '\n' + token.raw; + this.inlineQueue[this.inlineQueue.length - 1].src = lastToken.text; + } else if (!this.tokens.links[token.tag]) { this.tokens.links[token.tag] = { href: token.href, title: token.title diff --git a/src/Parser.js b/src/Parser.js index e804c143c4..ef5009aea8 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -149,7 +149,7 @@ module.exports = class Parser { if (item.task) { checkbox = this.renderer.checkbox(checked); if (loose) { - if (item.tokens.length > 0 && item.tokens[0].type === 'text') { + if (item.tokens.length > 0 && item.tokens[0].type === 'paragraph') { item.tokens[0].text = checkbox + ' ' + item.tokens[0].text; if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === 'text') { item.tokens[0].tokens[0].text = checkbox + ' ' + item.tokens[0].tokens[0].text; diff --git a/src/Tokenizer.js b/src/Tokenizer.js index 922452e7be..85bdb33675 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -164,145 +164,149 @@ module.exports = class Tokenizer { } list(src) { - const cap = this.rules.block.list.exec(src); + let cap = this.rules.block.list.exec(src); if (cap) { - let raw = cap[0]; - const bull = cap[2]; + let raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, + line, lines, itemContents; + + let bull = cap[1].trim(); const isordered = bull.length > 1; const list = { type: 'list', - raw, + raw: '', ordered: isordered, start: isordered ? +bull.slice(0, -1) : '', loose: false, items: [] }; - // Get each top-level item. - const itemMatch = cap[0].match(this.rules.block.item); - - let next = false, - item, - space, - bcurr, - bnext, - addBack, - loose, - istask, - ischecked, - endMatch; - - let l = itemMatch.length; - bcurr = this.rules.block.listItemStart.exec(itemMatch[0]); - for (let i = 0; i < l; i++) { - item = itemMatch[i]; - raw = item; - - if (!this.options.pedantic) { - // Determine if current item contains the end of the list - endMatch = item.match(new RegExp('\\n\\s*\\n {0,' + (bcurr[0].length - 1) + '}\\S')); - if (endMatch) { - addBack = item.length - endMatch.index + itemMatch.slice(i + 1).join('\n').length; - list.raw = list.raw.substring(0, list.raw.length - addBack); - - item = item.substring(0, endMatch.index); - raw = item; - l = i + 1; - } + bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`; + + if (this.options.pedantic) { + bull = isordered ? bull : '[*+-]'; + } + + // Get next list item + const itemRegex = new RegExp(`^( {0,3}${bull})((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))`); + + // Get each top-level item + while (src) { + if (this.rules.block.hr.test(src)) { // End list if we encounter an HR (possibly move into itemRegex?) + break; } - // Determine whether the next list item belongs here. - // Backpedal if it does not belong in this list. - if (i !== l - 1) { - bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]); - if ( - !this.options.pedantic - ? bnext[1].length >= bcurr[0].length || bnext[1].length > 3 - : bnext[1].length > bcurr[1].length - ) { - // nested list or continuation - itemMatch.splice(i, 2, itemMatch[i] + (!this.options.pedantic && bnext[1].length < bcurr[0].length && !itemMatch[i].match(/\n$/) ? '' : '\n') + itemMatch[i + 1]); - i--; - l--; - continue; - } else if ( - // different bullet style - !this.options.pedantic || this.options.smartLists - ? bnext[2][bnext[2].length - 1] !== bull[bull.length - 1] - : isordered === (bnext[2].length === 1) - ) { - addBack = itemMatch.slice(i + 1).join('\n').length; - list.raw = list.raw.substring(0, list.raw.length - addBack); - i = l - 1; - } - bcurr = bnext; + if (!(cap = itemRegex.exec(src))) { + break; } - // Remove the list item's bullet - // so it is seen as the next token. - space = item.length; - item = item.replace(/^ *([*+-]|\d+[.)]) ?/, ''); - - // Outdent whatever the - // list item contains. Hacky. - if (~item.indexOf('\n ')) { - space -= item.length; - item = !this.options.pedantic - ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') - : item.replace(/^ {1,4}/gm, ''); + lines = cap[2].split('\n'); + + if (this.options.pedantic) { + indent = 2; + itemContents = lines[0].trimLeft(); + } else { + indent = cap[2].search(/[^ ]/); // Find first non-space char + indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1 + itemContents = lines[0].slice(indent - cap[1].length); } - // trim item newlines at end - item = rtrim(item, '\n'); - if (i !== l - 1) { - raw = raw + '\n'; + blankLine = false; + raw = cap[0]; + + if (!lines[0] && /^ *$/.test(lines[1])) { // items begin with at most one blank line + raw = cap[1] + lines.slice(0, 2).join('\n') + '\n'; + list.loose = true; + lines = []; } - // Determine whether item is loose or not. - // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ - // for discount behavior. - loose = next || /\n\n(?!\s*$)/.test(raw); - if (i !== l - 1) { - next = raw.slice(-2) === '\n\n'; - if (!loose) loose = next; + const nextBulletRegex = new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])`); + + for (i = 1; i < lines.length; i++) { + line = lines[i]; + + if (this.options.pedantic) { // Re-align to follow commonmark nesting rules + line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); + } + + // End list item if found start of new bullet + if (nextBulletRegex.test(line)) { + raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; + break; + } + + // Until we encounter a blank line, item contents do not need indentation + if (!blankLine) { + if (!line.trim()) { // Check if current line is empty + blankLine = true; + } + + // Dedent if possible + if (line.search(/[^ ]/) >= indent) { + itemContents += '\n' + line.slice(indent); + } else { + itemContents += '\n' + line; + } + continue; + } + + // Dedent this line + if (line.search(/[^ ]/) >= indent || !line.trim()) { + itemContents += '\n' + line.slice(indent); + continue; + } else { // Line was not properly indented; end of this item + raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; + break; + } } - if (loose) { - list.loose = true; + if (!list.loose) { + // If the previous item ended with a blank line, the list is loose + if (endsWithBlankLine) { + list.loose = true; + } else if (/\n *\n *$/.test(raw)) { + endsWithBlankLine = true; + } } // Check for task list items if (this.options.gfm) { - istask = /^\[[ xX]\] /.test(item); - ischecked = undefined; + istask = /^\[[ xX]\] /.exec(itemContents); if (istask) { - ischecked = item[1] !== ' '; - item = item.replace(/^\[[ xX]\] +/, ''); + ischecked = istask[0] !== '[ ] '; + itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); } } - this.lexer.state.top = false; - - const token = { + list.items.push({ type: 'list_item', - raw, - task: istask, + raw: raw, + task: !!istask, checked: ischecked, - loose: loose, - text: item, - tokens: this.lexer.blockTokens(item, []) - }; + loose: false, + text: itemContents + }); - // this.lexer.inline(token.text, ) - list.items.push(token); + list.raw += raw; + src = src.slice(raw.length); } - // l2 = token.items.length; - // for (j = 0; j < l2; j++) { - // this.inline(token.items[j].tokens); - // } - // break; + // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic + list.items[list.items.length - 1].raw = raw.trimRight(); + list.items[list.items.length - 1].text = itemContents.trimRight(); + list.raw = list.raw.trimRight(); + + const l = list.items.length; + + // Item child tokens handled here at end because we needed to have the final item to trim it first + for (i = 0; i < l; i++) { + this.lexer.state.top = false; + list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); + if (list.items[i].tokens.some(t => t.type === 'space')) { + list.loose = true; + list.items[i].loose = true; + } + } return list; } diff --git a/src/rules.js b/src/rules.js index 13961f2251..39fa8e56c4 100644 --- a/src/rules.js +++ b/src/rules.js @@ -10,11 +10,11 @@ const { const block = { newline: /^(?: *(?:\n|$))+/, code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, - fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, + fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, - list: /^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/, + list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/, html: '^ {0,3}(?:' // optional indentation + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + '|comment[^\\n]*(\\n+|$)' // (2) @@ -42,11 +42,6 @@ block.def = edit(block.def) .getRegex(); block.bullet = /(?:[*+-]|\d{1,9}[.)])/; -block.item = /^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/; -block.item = edit(block.item, 'gm') - .replace(/bull/g, block.bullet) - .getRegex(); - block.listItemStart = edit(/^( *)(bull) */) .replace('bull', block.bullet) .getRegex(); diff --git a/test/specs/commonmark/commonmark.0.30.json b/test/specs/commonmark/commonmark.0.30.json index 18a49682bd..62a0dfe076 100644 --- a/test/specs/commonmark/commonmark.0.30.json +++ b/test/specs/commonmark/commonmark.0.30.json @@ -2107,8 +2107,7 @@ "example": 262, "start_line": 4314, "end_line": 4326, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", @@ -2124,8 +2123,7 @@ "example": 264, "start_line": 4359, "end_line": 4377, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "123456789. ok\n", @@ -2197,8 +2195,7 @@ "example": 273, "start_line": 4493, "end_line": 4509, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "1. indented code\n\n paragraph\n\n more code\n", @@ -2206,8 +2203,7 @@ "example": 274, "start_line": 4515, "end_line": 4531, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": " foo\n\nbar\n", @@ -2239,8 +2235,7 @@ "example": 278, "start_line": 4596, "end_line": 4617, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "- \n foo\n", @@ -2256,8 +2251,7 @@ "example": 280, "start_line": 4636, "end_line": 4645, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "- foo\n-\n- bar\n", @@ -2289,8 +2283,7 @@ "example": 284, "start_line": 4695, "end_line": 4701, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "foo\n*\n\nfoo\n1.\n", @@ -2466,8 +2459,7 @@ "example": 306, "start_line": 5388, "end_line": 5407, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", @@ -2475,8 +2467,7 @@ "example": 307, "start_line": 5409, "end_line": 5431, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", @@ -2556,8 +2547,7 @@ "example": 317, "start_line": 5645, "end_line": 5663, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", @@ -2565,8 +2555,7 @@ "example": 318, "start_line": 5668, "end_line": 5687, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- a\n - b\n\n c\n- d\n", @@ -2574,8 +2563,7 @@ "example": 319, "start_line": 5694, "end_line": 5712, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "* a\n > b\n >\n* c\n", diff --git a/test/specs/gfm/commonmark.0.30.json b/test/specs/gfm/commonmark.0.30.json index 1b01311866..e32558a3a3 100644 --- a/test/specs/gfm/commonmark.0.30.json +++ b/test/specs/gfm/commonmark.0.30.json @@ -2107,8 +2107,7 @@ "example": 262, "start_line": 4314, "end_line": 4326, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "1. foo\n\n ```\n bar\n ```\n\n baz\n\n > bam\n", @@ -2124,8 +2123,7 @@ "example": 264, "start_line": 4359, "end_line": 4377, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "123456789. ok\n", @@ -2197,8 +2195,7 @@ "example": 273, "start_line": 4493, "end_line": 4509, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "1. indented code\n\n paragraph\n\n more code\n", @@ -2206,8 +2203,7 @@ "example": 274, "start_line": 4515, "end_line": 4531, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": " foo\n\nbar\n", @@ -2239,8 +2235,7 @@ "example": 278, "start_line": 4596, "end_line": 4617, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "- \n foo\n", @@ -2256,8 +2251,7 @@ "example": 280, "start_line": 4636, "end_line": 4645, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "- foo\n-\n- bar\n", @@ -2289,8 +2283,7 @@ "example": 284, "start_line": 4695, "end_line": 4701, - "section": "List items", - "shouldFail": true + "section": "List items" }, { "markdown": "foo\n*\n\nfoo\n1.\n", @@ -2466,8 +2459,7 @@ "example": 306, "start_line": 5388, "end_line": 5407, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- foo\n - bar\n - baz\n\n\n bim\n", @@ -2475,8 +2467,7 @@ "example": 307, "start_line": 5409, "end_line": 5431, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- foo\n- bar\n\n\n\n- baz\n- bim\n", @@ -2556,8 +2547,7 @@ "example": 317, "start_line": 5645, "end_line": 5663, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- a\n- ```\n b\n\n\n ```\n- c\n", @@ -2565,8 +2555,7 @@ "example": 318, "start_line": 5668, "end_line": 5687, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "- a\n - b\n\n c\n- d\n", @@ -2574,8 +2563,7 @@ "example": 319, "start_line": 5694, "end_line": 5712, - "section": "Lists", - "shouldFail": true + "section": "Lists" }, { "markdown": "* a\n > b\n >\n* c\n", diff --git a/test/specs/new/def_blocks.html b/test/specs/new/def_blocks.html index 5d8de49c04..23207da91e 100644 --- a/test/specs/new/def_blocks.html +++ b/test/specs/new/def_blocks.html @@ -12,13 +12,14 @@
hello
+hello +[4]: hello
+Just a note, I've found that I can't test my markdown parser vs others. For example, both markdown.js and showdown code blocks in lists wrong. They're also completely inconsistent with regards to paragraphs in list items.
A link. Not anymore.
List Item 1
List Item 2
Code goes here.
-Lots of it...
List Item 3 The final item.
List Item 4 The real final item.
Paragraph.
- bq Item 1
- bq Item 2
- New bq Item 1
- New bq Item 2 Text here
Another blockquote! I really need to get more creative with mockup text.. markdown.js breaks here again
Hello world. Here is a link. And an image .
Code goes here.
-Lots of it...
diff --git a/test/specs/new/main.md b/test/specs/new/main.md
deleted file mode 100644
index 58e17a6a76..0000000000
--- a/test/specs/new/main.md
+++ /dev/null
@@ -1,55 +0,0 @@
-[test]: http://google.com/ "Google"
-
-# A heading
-
-Just a note, I've found that I can't test my markdown parser vs others.
-For example, both markdown.js and showdown code blocks in lists wrong. They're
-also completely [inconsistent][test] with regards to paragraphs in list items.
-
-A link. Not anymore.
-
-
-
-* List Item 1
-
-* List Item 2
- * New List Item 1
- Hi, this is a list item.
- * New List Item 2
- Another item
- Code goes here.
- Lots of it...
- * New List Item 3
- The last item
-
-* List Item 3
-The final item.
-
-* List Item 4
-The real final item.
-
-Paragraph.
-
-> * bq Item 1
-> * bq Item 2
-> * New bq Item 1
-> * New bq Item 2
-> Text here
-
-* * *
-
-> Another blockquote!
-> I really need to get
-> more creative with
-> mockup text..
-> markdown.js breaks here again
-
-Another Heading
--------------
-
-Hello *world*. Here is a [link](//hello).
-And an image .
-
- Code goes here.
- Lots of it...
diff --git a/test/unit/Lexer-spec.js b/test/unit/Lexer-spec.js
index f94cd6e70d..af3f5781b1 100644
--- a/test/unit/Lexer-spec.js
+++ b/test/unit/Lexer-spec.js
@@ -295,7 +295,7 @@ a | b
tokens: [
{
type: 'list',
- raw: '- item 1\n- item 2\n',
+ raw: '- item 1\n- item 2',
ordered: false,
start: '',
loose: false,
@@ -316,7 +316,7 @@ a | b
},
{
type: 'list_item',
- raw: '- item 2\n',
+ raw: '- item 2',
task: false,
checked: undefined,
loose: false,
@@ -343,7 +343,7 @@ a | b
tokens: jasmine.arrayContaining([
jasmine.objectContaining({
type: 'list',
- raw: '1. item 1\n2. item 2\n',
+ raw: '1. item 1\n2. item 2',
ordered: true,
start: 1,
items: [
@@ -351,7 +351,7 @@ a | b
raw: '1. item 1\n'
}),
jasmine.objectContaining({
- raw: '2. item 2\n'
+ raw: '2. item 2'
})
]
})
@@ -368,7 +368,7 @@ a | b
tokens: jasmine.arrayContaining([
jasmine.objectContaining({
type: 'list',
- raw: '1) item 1\n2) item 2\n',
+ raw: '1) item 1\n2) item 2',
ordered: true,
start: 1,
items: [
@@ -376,7 +376,7 @@ a | b
raw: '1) item 1\n'
}),
jasmine.objectContaining({
- raw: '2) item 2\n'
+ raw: '2) item 2'
})
]
})
@@ -395,7 +395,7 @@ paragraph
tokens: [
{
type: 'list',
- raw: '- item 1\n- item 2\n\n',
+ raw: '- item 1\n- item 2',
ordered: false,
start: '',
loose: false,
@@ -416,7 +416,7 @@ paragraph
},
{
type: 'list_item',
- raw: '- item 2\n\n',
+ raw: '- item 2',
task: false,
checked: undefined,
loose: false,
@@ -430,6 +430,7 @@ paragraph
}
]
},
+ { type: 'space', raw: '\n\n' },
{
type: 'paragraph',
raw: 'paragraph',
@@ -453,7 +454,7 @@ paragraph
tokens: jasmine.arrayContaining([
jasmine.objectContaining({
type: 'list',
- raw: '2. item 1\n3. item 2\n',
+ raw: '2. item 1\n3. item 2',
ordered: true,
start: 2,
items: [
@@ -461,7 +462,7 @@ paragraph
raw: '2. item 1\n'
}),
jasmine.objectContaining({
- raw: '3. item 2\n'
+ raw: '3. item 2'
})
]
})
@@ -479,14 +480,14 @@ paragraph
tokens: jasmine.arrayContaining([
jasmine.objectContaining({
type: 'list',
- raw: '- item 1\n\n- item 2\n',
+ raw: '- item 1\n\n- item 2',
loose: true,
items: [
jasmine.objectContaining({
raw: '- item 1\n\n'
}),
jasmine.objectContaining({
- raw: '- item 2\n'
+ raw: '- item 2'
})
]
})
@@ -503,7 +504,7 @@ paragraph
tokens: jasmine.arrayContaining([
jasmine.objectContaining({
type: 'list',
- raw: '- [ ] item 1\n- [x] item 2\n',
+ raw: '- [ ] item 1\n- [x] item 2',
items: [
jasmine.objectContaining({
raw: '- [ ] item 1\n',
@@ -511,7 +512,7 @@ paragraph
checked: false
}),
jasmine.objectContaining({
- raw: '- [x] item 2\n',
+ raw: '- [x] item 2',
task: true,
checked: true
})
diff --git a/test/unit/marked-spec.js b/test/unit/marked-spec.js
index 6b67a8fe61..79fa151520 100644
--- a/test/unit/marked-spec.js
+++ b/test/unit/marked-spec.js
@@ -1001,6 +1001,7 @@ br
['heading', '# heading'],
['text', 'heading'],
['code', '```code```'],
+ ['space', ''],
['table', '| a | b ||---|---|| 1 | 2 || 3 | 4 |'],
['text', 'a'],
['text', 'b'],
@@ -1015,6 +1016,7 @@ br
['list_item', '- list'],
['text', 'list'],
['text', 'list'],
+ ['space', ''],
['html', 'there should be a single space in the line above
+there should be a single space at the end of every line above
diff --git a/test/specs/new/space_after_table.md b/test/specs/new/space_after_table.md index 385ffe6229..94b80d6a49 100644 --- a/test/specs/new/space_after_table.md +++ b/test/specs/new/space_after_table.md @@ -1,8 +1,8 @@ --- gfm: true --- -| a | b | -|---|---| -| 1 | 2 | +| a | b | +|---|---| +| 1 | 2 | -there should be a single space in the line above \ No newline at end of file +there should be a single space at the end of every line above From 3b7bd95761e1326310e4dbca77b6d760d1700afb Mon Sep 17 00:00:00 2001 From: MarkedJS bot <> Date: Wed, 8 Sep 2021 20:22:04 +0000 Subject: [PATCH 089/208] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20build=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/marked.esm.js | 2 +- lib/marked.js | 2 +- marked.min.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/marked.esm.js b/lib/marked.esm.js index 5fafa8d6b4..937db783d8 100644 --- a/lib/marked.esm.js +++ b/lib/marked.esm.js @@ -1161,7 +1161,7 @@ block$1.normal = merge$1({}, block$1); block$1.gfm = merge$1({}, block$1.normal, { table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?' // Align + + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); diff --git a/lib/marked.js b/lib/marked.js index b35242429a..b72d59461b 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1267,7 +1267,7 @@ block$1.gfm = merge$1({}, block$1.normal, { table: '^ *([^\\n ].*\\|.*)\\n' // Header - + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?' // Align + + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); diff --git a/marked.min.js b/marked.min.js index b165759a53..8a8637ad96 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u
'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file From 784ba5fe9b10dab594c89560d54e314d4c3a229c Mon Sep 17 00:00:00 2001 From: semantic-release-bot
foo bar
+ +foo bar foo
+ +foo bar
+ +foo bar foo
diff --git a/test/specs/new/em_strong_adjacent_mixed.md b/test/specs/new/em_strong_adjacent_mixed.md new file mode 100644 index 0000000000..86cd411dc0 --- /dev/null +++ b/test/specs/new/em_strong_adjacent_mixed.md @@ -0,0 +1,7 @@ +_**foo**_ **bar** + +_**foo**_ **bar** _**foo**_ + +*__foo__* __bar__ + +*__foo__* __bar__ *__foo__* diff --git a/test/specs/new/em_strong_orphaned_nesting.html b/test/specs/new/em_strong_orphaned_nesting.html new file mode 100644 index 0000000000..6d91766024 --- /dev/null +++ b/test/specs/new/em_strong_orphaned_nesting.html @@ -0,0 +1 @@ +foo_bar
diff --git a/test/specs/new/em_strong_orphaned_nesting.md b/test/specs/new/em_strong_orphaned_nesting.md new file mode 100644 index 0000000000..cbeb7bad97 --- /dev/null +++ b/test/specs/new/em_strong_orphaned_nesting.md @@ -0,0 +1 @@ +_**foo_bar**_ From 8c00ed31c5a671d356de5103a7af06e211e253f4 Mon Sep 17 00:00:00 2001 From: Tony Brix'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u
'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file From 189fef4d430506559fa61a1feb600312c0ba4782 Mon Sep 17 00:00:00 2001 From: semantic-release-bot
'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,function(e){"use strict";function r(e,t){for(var u=0;u
'+(u?e:J(e,!0))+"
\n":""+(u?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+ae(e.message+"",!0)+"";throw e}}De.options=De.setOptions=function(e){return se(De.defaults,e),oe(De.defaults),De},De.getDefaults=$,De.defaults=w,De.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+ae(e.message+"",!0)+"";throw e}},De.Parser=ne,De.parser=ne.parse,De.Renderer=ie,De.TextRenderer=B,De.Lexer=ue,De.lexer=ue.lex,De.Tokenizer=re,De.Slugger=z,De.parse=De,t.exports=De;R=t.exports.parse=De,v=t.exports.Parser=ne,_=t.exports.parser=ne.parse,T=t.exports.Renderer=ie,b=t.exports.TextRenderer=B,$=t.exports.Lexer=ue,w=t.exports.lexer=ue.lex,B=t.exports.Tokenizer=re,z=t.exports.Slugger=z,t=t.exports;e.Lexer=$,e.Parser=v,e.Renderer=T,e.Slugger=z,e.TextRenderer=b,e.Tokenizer=B,e.default=t,e.lexer=w,e.parse=R,e.parser=_,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/src/marked.js b/src/marked.js index e91be9e10e..09b045532a 100644 --- a/src/marked.js +++ b/src/marked.js @@ -326,17 +326,21 @@ marked.parseInline = function(src, opt) { marked.Parser = Parser; marked.parser = Parser.parse; - marked.Renderer = Renderer; marked.TextRenderer = TextRenderer; - marked.Lexer = Lexer; marked.lexer = Lexer.lex; - marked.Tokenizer = Tokenizer; - marked.Slugger = Slugger; - marked.parse = marked; module.exports = marked; +module.exports.parse = marked; +module.exports.Parser = Parser; +module.exports.parser = Parser.parse; +module.exports.Renderer = Renderer; +module.exports.TextRenderer = TextRenderer; +module.exports.Lexer = Lexer; +module.exports.lexer = Lexer.lex; +module.exports.Tokenizer = Tokenizer; +module.exports.Slugger = Slugger; From 6c65489af8a28ed002b71381851b4622a4b10625 Mon Sep 17 00:00:00 2001 From: semantic-release-bot
'+(u?e:J(e,!0))+"
\n":""+(u?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+ae(e.message+"",!0)+"";throw e}}De.options=De.setOptions=function(e){return se(De.defaults,e),oe(De.defaults),De},De.getDefaults=$,De.defaults=w,De.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+ae(e.message+"",!0)+"";throw e}},De.Parser=ne,De.parser=ne.parse,De.Renderer=ie,De.TextRenderer=B,De.Lexer=ue,De.lexer=ue.lex,De.Tokenizer=re,De.Slugger=z,De.parse=De,t.exports=De;R=t.exports.parse=De,v=t.exports.Parser=ne,_=t.exports.parser=ne.parse,T=t.exports.Renderer=ie,b=t.exports.TextRenderer=B,$=t.exports.Lexer=ue,w=t.exports.lexer=ue.lex,B=t.exports.Tokenizer=re,z=t.exports.Slugger=z,t=t.exports;e.Lexer=$,e.Parser=v,e.Renderer=T,e.Slugger=z,e.TextRenderer=b,e.Tokenizer=B,e.default=t,e.lexer=w,e.parse=R,e.parser=_,Object.defineProperty(e,"__esModule",{value:!0})}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).marked={})}(this,function(e){"use strict";function r(e,t){for(var u=0;u
'+(u?e:J(e,!0))+"
\n":""+(u?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+ae(e.message+"",!0)+"";throw e}}De.options=De.setOptions=function(e){return se(De.defaults,e),oe(De.defaults),De},De.getDefaults=$,De.defaults=w,De.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+ae(e.message+"",!0)+"";throw e}},De.Parser=ne,De.parser=ne.parse,De.Renderer=ie,De.TextRenderer=B,De.Lexer=ue,De.lexer=ue.lex,De.Tokenizer=re,De.Slugger=z,De.parse=De,t.exports=De;R=t.exports.parse=De,v=t.exports.Parser=ne,_=t.exports.parser=ne.parse,T=t.exports.Renderer=ie,b=t.exports.TextRenderer=B,$=t.exports.Lexer=ue,w=t.exports.lexer=ue.lex,B=t.exports.Tokenizer=re,z=t.exports.Slugger=z,t=t.exports;e.Lexer=$,e.Parser=v,e.Renderer=T,e.Slugger=z,e.TextRenderer=b,e.Tokenizer=B,e.default=t,e.lexer=w,e.parse=R,e.parser=_}); \ No newline at end of file diff --git a/rollup.config.js b/rollup.config.js index d5ff510e4d..125a9f77a8 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -7,7 +7,8 @@ module.exports = { output: { file: 'lib/marked.js', format: 'umd', - name: 'marked' + name: 'marked', + esModule: false }, plugins: [ license({ From 3306813f395d15068f56d8495f92bc8e827f13c0 Mon Sep 17 00:00:00 2001 From: semantic-release-bot
'+(u?e:J(e,!0))+"
\n":""+(u?e:J(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+ae(e.message+"",!0)+"";throw e}}De.options=De.setOptions=function(e){return se(De.defaults,e),oe(De.defaults),De},De.getDefaults=$,De.defaults=w,De.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+ae(e.message+"",!0)+"";throw e}},De.Parser=ne,De.parser=ne.parse,De.Renderer=ie,De.TextRenderer=B,De.Lexer=ue,De.lexer=ue.lex,De.Tokenizer=re,De.Slugger=z,De.parse=De,t.exports=De;R=t.exports.parse=De,v=t.exports.Parser=ne,_=t.exports.parser=ne.parse,T=t.exports.Renderer=ie,b=t.exports.TextRenderer=B,$=t.exports.Lexer=ue,w=t.exports.lexer=ue.lex,B=t.exports.Tokenizer=re,z=t.exports.Slugger=z,t=t.exports;e.Lexer=$,e.Parser=v,e.Renderer=T,e.Slugger=z,e.TextRenderer=b,e.Tokenizer=B,e.default=t,e.lexer=w,e.parse=R,e.parser=_}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u
'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file diff --git a/rollup.config.esm.js b/rollup.config.esm.js index f0ac4e161b..931fbe1437 100644 --- a/rollup.config.esm.js +++ b/rollup.config.esm.js @@ -2,7 +2,7 @@ const commonjs = require('@rollup/plugin-commonjs'); const license = require('rollup-plugin-license'); module.exports = { - input: 'src/marked.js', + input: 'src/esm-entry.js', output: { file: 'lib/marked.esm.js', format: 'esm' diff --git a/rollup.config.js b/rollup.config.js index 125a9f77a8..32b6876467 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -8,7 +8,7 @@ module.exports = { file: 'lib/marked.js', format: 'umd', name: 'marked', - esModule: false + exports: 'default' }, plugins: [ license({ diff --git a/src/esm-entry.js b/src/esm-entry.js new file mode 100644 index 0000000000..72056d6da0 --- /dev/null +++ b/src/esm-entry.js @@ -0,0 +1,18 @@ +const marked = require('./marked.js'); +const Lexer = require('./Lexer.js'); +const Parser = require('./Parser.js'); +const Tokenizer = require('./Tokenizer.js'); +const Renderer = require('./Renderer.js'); +const TextRenderer = require('./TextRenderer.js'); +const Slugger = require('./Slugger.js'); + +module.exports = marked; +module.exports.parse = marked; +module.exports.Parser = Parser; +module.exports.parser = Parser.parse; +module.exports.Renderer = Renderer; +module.exports.TextRenderer = TextRenderer; +module.exports.Lexer = Lexer; +module.exports.lexer = Lexer.lex; +module.exports.Tokenizer = Tokenizer; +module.exports.Slugger = Slugger; diff --git a/src/marked.js b/src/marked.js index 09b045532a..f9186bb372 100644 --- a/src/marked.js +++ b/src/marked.js @@ -335,12 +335,3 @@ marked.Slugger = Slugger; marked.parse = marked; module.exports = marked; -module.exports.parse = marked; -module.exports.Parser = Parser; -module.exports.parser = Parser.parse; -module.exports.Renderer = Renderer; -module.exports.TextRenderer = TextRenderer; -module.exports.Lexer = Lexer; -module.exports.lexer = Lexer.lex; -module.exports.Tokenizer = Tokenizer; -module.exports.Slugger = Slugger; From b0caae0a81a171d2ac91987d40aa168619e2d7c2 Mon Sep 17 00:00:00 2001 From: Tony Brix
text walked
'); + }); }); From 48e5bd0add83dcefb0519d6fe3823cdf868b5d97 Mon Sep 17 00:00:00 2001 From: MarkedJS bot <> Date: Sun, 24 Oct 2021 05:05:16 +0000 Subject: [PATCH 123/208] =?UTF-8?q?=F0=9F=97=9C=EF=B8=8F=20build=20[skip?= =?UTF-8?q?=20ci]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/marked.esm.js | 6 +++--- lib/marked.js | 8 +++----- marked.min.js | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/marked.esm.js b/lib/marked.esm.js index b0ec796416..23e4d89095 100644 --- a/lib/marked.esm.js +++ b/lib/marked.esm.js @@ -2638,10 +2638,10 @@ marked$1.use = function(...args) { // ==-- Parse WalkTokens extensions --== // if (pack.walkTokens) { const walkTokens = marked$1.defaults.walkTokens; - opts.walkTokens = (token) => { + opts.walkTokens = function(token) { pack.walkTokens.call(this, token); if (walkTokens) { - walkTokens(token); + walkTokens.call(this, token); } }; } @@ -2660,7 +2660,7 @@ marked$1.use = function(...args) { marked$1.walkTokens = function(tokens, callback) { for (const token of tokens) { - callback(token); + callback.call(marked$1, token); switch (token.type) { case 'table': { for (const cell of token.header) { diff --git a/lib/marked.js b/lib/marked.js index dfe27f780a..d290cfdb82 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -2696,8 +2696,6 @@ */ marked.use = function () { - var _this = this; - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } @@ -2844,10 +2842,10 @@ var walkTokens = marked.defaults.walkTokens; opts.walkTokens = function (token) { - pack.walkTokens.call(_this, token); + pack.walkTokens.call(this, token); if (walkTokens) { - walkTokens(token); + walkTokens.call(this, token); } }; } @@ -2867,7 +2865,7 @@ marked.walkTokens = function (tokens, callback) { var _loop3 = function _loop3() { var token = _step.value; - callback(token); + callback.call(marked, token); switch (token.type) { case 'table': diff --git a/marked.min.js b/marked.min.js index f59c699bd7..edfc708a21 100644 --- a/marked.min.js +++ b/marked.min.js @@ -3,4 +3,4 @@ * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var u=this,e=arguments.length,t=new Array(e),n=0;n
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).marked=t()}(this,function(){"use strict";function r(e,t){for(var u=0;u
'+(u?e:V(e,!0))+"
\n":""+(u?e:V(e,!0))+"
\n"},t.blockquote=function(e){return"\n"+e+"\n"},t.html=function(e){return e},t.heading=function(e,t,u,n){return this.options.headerIds?"
"+e+"
\n"},t.table=function(e,t){return""+e+"
"},t.br=function(){return this.options.xhtml?""+se(e.message+"",!0)+"";throw e}}return ae.options=ae.setOptions=function(e){return re(ae.defaults,e),le(ae.defaults),ae},ae.getDefaults=$,ae.defaults=x,ae.use=function(){for(var e=arguments.length,t=new Array(e),u=0;u
"+se(e.message+"",!0)+"";throw e}},ae.Parser=te,ae.parser=te.parse,ae.Renderer=ne,ae.TextRenderer=S,ae.Lexer=ee,ae.lexer=ee.lex,ae.Tokenizer=ue,ae.Slugger=B,ae.parse=ae}); \ No newline at end of file From d7f5e68128bb9473de3c4385cad39dfc4eb04cca Mon Sep 17 00:00:00 2001 From: semantic-release-bot
strong em
' const inlineHtml = marked.parseInline('**strong** _em_'); @@ -87,7 +88,7 @@ marked.setOptions({ } }); -marked(markdownString, (err, html) => { +marked.parse(markdownString, (err, html) => { console.log(html); }); ``` @@ -105,18 +106,18 @@ Marked can be run in a [worker thread](https://nodejs.org/api/worker_threads.htm ```js // markedWorker.js -const marked = require('marked'); -const { parentPort } = require('worker_threads'); +import { marked } from 'marked'; +import { parentPort } from 'worker_threads'; parentPort.on('message', (markdownString) => { - parentPort.postMessage(marked(markdownString)); + parentPort.postMessage(marked.parse(markdownString)); }); ``` ```js // index.js -const { Worker } = require('worker_threads'); +import { Worker } from 'worker_threads'; const markedWorker = new Worker('./markedWorker.js'); const markedTimeout = setTimeout(() => { @@ -144,7 +145,7 @@ importScripts('path/to/marked.min.js'); onmessage = (e) => { const markdownString = e.data - postMessage(marked(markdownString)); + postMessage(marked.parse(markdownString)); }; ``` diff --git a/docs/USING_PRO.md b/docs/USING_PRO.md index 985a685dae..f0e32cea7d 100644 --- a/docs/USING_PRO.md +++ b/docs/USING_PRO.md @@ -8,7 +8,7 @@ To champion the single-responsibility and open/closed principles, we have tried ```js -const marked = require('marked'); +import { marked } from 'marked'; marked.use({ pedantic: false, @@ -69,7 +69,7 @@ Calling `marked.use()` to override the same function multiple times will give pr ```js // Create reference instance -const marked = require('marked'); +import { marked } from 'marked'; // Override function const renderer = { @@ -89,7 +89,7 @@ const renderer = { marked.use({ renderer }); // Run marked -console.log(marked('# heading+')); +console.log(marked.parse('# heading+')); ``` **Output:** @@ -173,7 +173,7 @@ Calling `marked.use()` to override the same function multiple times will give pr ```js // Create reference instance -const marked = require('marked'); +import { marked } from 'marked'; // Override function const tokenizer = { @@ -195,7 +195,7 @@ const tokenizer = { marked.use({ tokenizer }); // Run marked -console.log(marked('$ latex code $\n\n` other code `')); +console.log(marked.parse('$ latex code $\n\n` other code `')); ``` **Output:** @@ -264,7 +264,7 @@ The walkTokens function gets called with every token. Child tokens are called be **Example:** Overriding heading tokens to start at h2. ```js -const marked = require('marked'); +import { marked } from 'marked'; // Override function const walkTokens = (token) => { @@ -276,7 +276,7 @@ const walkTokens = (token) => { marked.use({ walkTokens }); // Run marked -console.log(marked('# heading 2\n\n## heading 3')); +console.log(marked.parse('# heading 2\n\n## heading 3')); ``` **Output:** @@ -422,7 +422,7 @@ marked.use({ extensions: [descriptionList] }); marked.use({ extensions: [description] }); marked.use({ walkTokens }) -console.log(marked('A Description List:\n' +console.log(marked.parse('A Description List:\n' + ': Topic 1 : Description 1\n' + ': **Topic 2** : *Description 2*')); ``` @@ -497,7 +497,7 @@ The Lexer builds an array of tokens, which will be passed to the Parser. The Parser processes each token in the token array: ``` js -const marked = require('marked'); +import { marked } from 'marked'; const md = ` # heading diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 560312608d..40a8c4840a 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -34,7 +34,7 @@ var inputDirty = true; var $activeOutputElem = null; var search = searchToObject(); var markedVersions = { - master: 'https://cdn.jsdelivr.net/gh/markedjs/marked/lib/marked.js' + master: 'https://cdn.jsdelivr.net/gh/markedjs/marked/marked.min.js' }; var markedVersionCache = {}; var delayTime = 1; @@ -109,7 +109,7 @@ function setInitialVersion() { .then(function(json) { for (var i = 0; i < json.versions.length; i++) { var ver = json.versions[i]; - markedVersions[ver] = 'https://cdn.jsdelivr.net/npm/marked@' + ver + '/lib/marked.js'; + markedVersions[ver] = 'https://cdn.jsdelivr.net/npm/marked@' + ver + '/marked.min.js'; var opt = document.createElement('option'); opt.textContent = ver; opt.value = ver; @@ -122,7 +122,7 @@ function setInitialVersion() { return res.json(); }) .then(function(json) { - markedVersions.master = 'https://cdn.jsdelivr.net/gh/markedjs/marked@' + json[0].sha + '/lib/marked.js'; + markedVersions.master = 'https://cdn.jsdelivr.net/gh/markedjs/marked@' + json[0].sha + '/marked.min.js'; }) .catch(function() { // do nothing @@ -262,7 +262,7 @@ function addCommitVersion(value, text, commit) { if (markedVersions[value]) { return; } - markedVersions[value] = 'https://cdn.jsdelivr.net/gh/markedjs/marked@' + commit + '/lib/marked.js'; + markedVersions[value] = 'https://cdn.jsdelivr.net/gh/markedjs/marked@' + commit + '/marked.min.js'; var opt = document.createElement('option'); opt.textContent = text; opt.value = value; diff --git a/index.js b/index.js deleted file mode 100644 index a12f90569f..0000000000 --- a/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/marked'); diff --git a/jasmine.json b/jasmine.json index bec425427d..c2728eef27 100644 --- a/jasmine.json +++ b/jasmine.json @@ -6,6 +6,7 @@ "helpers": [ "helpers/helpers.js" ], + "jsLoader": "import", "stopSpecOnExpectationFailure": false, "random": true } diff --git a/lib/marked.cjs b/lib/marked.cjs new file mode 100644 index 0000000000..2f2ca9cacb --- /dev/null +++ b/lib/marked.cjs @@ -0,0 +1,2913 @@ +/** + * marked - a markdown parser + * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) + * https://github.com/markedjs/marked + */ + +/** + * DO NOT EDIT THIS FILE + * The code in this file is generated from files in ./src/ + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.marked = {})); +})(this, (function (exports) { 'use strict'; + + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + return Constructor; + } + + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _arrayLikeToArray(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); + } + + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; + + return arr2; + } + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { + var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; + if (it) return (it = it.call(o)).next.bind(it); + + if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { + if (it) o = it; + var i = 0; + return function () { + if (i >= o.length) return { + done: true + }; + return { + done: false, + value: o[i++] + }; + }; + } + + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + function getDefaults() { + return { + baseUrl: null, + breaks: false, + extensions: null, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'language-', + mangle: true, + pedantic: false, + renderer: null, + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tokenizer: null, + walkTokens: null, + xhtml: false + }; + } + exports.defaults = getDefaults(); + function changeDefaults(newDefaults) { + exports.defaults = newDefaults; + } + + /** + * Helpers + */ + var escapeTest = /[&<>"']/; + var escapeReplace = /[&<>"']/g; + var escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; + var escapeReplaceNoEncode = /[<>"']|&(?!#?\w+;)/g; + var escapeReplacements = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + var getEscapeReplacement = function getEscapeReplacement(ch) { + return escapeReplacements[ch]; + }; + + function escape(html, encode) { + if (encode) { + if (escapeTest.test(html)) { + return html.replace(escapeReplace, getEscapeReplacement); + } + } else { + if (escapeTestNoEncode.test(html)) { + return html.replace(escapeReplaceNoEncode, getEscapeReplacement); + } + } + + return html; + } + var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; + function unescape(html) { + // explicitly match decimal, hex, and named HTML entities + return html.replace(unescapeTest, function (_, n) { + n = n.toLowerCase(); + if (n === 'colon') return ':'; + + if (n.charAt(0) === '#') { + return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); + } + + return ''; + }); + } + var caret = /(^|[^\[])\^/g; + function edit(regex, opt) { + regex = regex.source || regex; + opt = opt || ''; + var obj = { + replace: function replace(name, val) { + val = val.source || val; + val = val.replace(caret, '$1'); + regex = regex.replace(name, val); + return obj; + }, + getRegex: function getRegex() { + return new RegExp(regex, opt); + } + }; + return obj; + } + var nonWordAndColonTest = /[^\w:]/g; + var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; + function cleanUrl(sanitize, base, href) { + if (sanitize) { + var prot; + + try { + prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase(); + } catch (e) { + return null; + } + + if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0 || prot.indexOf('data:') === 0) { + return null; + } + } + + if (base && !originIndependentUrl.test(href)) { + href = resolveUrl(base, href); + } + + try { + href = encodeURI(href).replace(/%25/g, '%'); + } catch (e) { + return null; + } + + return href; + } + var baseUrls = {}; + var justDomain = /^[^:]+:\/*[^/]*$/; + var protocol = /^([^:]+:)[\s\S]*$/; + var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/; + function resolveUrl(base, href) { + if (!baseUrls[' ' + base]) { + // we can ignore everything in base after the last slash of its path component, + // but we might need to add _that_ + // https://tools.ietf.org/html/rfc3986#section-3 + if (justDomain.test(base)) { + baseUrls[' ' + base] = base + '/'; + } else { + baseUrls[' ' + base] = rtrim(base, '/', true); + } + } + + base = baseUrls[' ' + base]; + var relativeBase = base.indexOf(':') === -1; + + if (href.substring(0, 2) === '//') { + if (relativeBase) { + return href; + } + + return base.replace(protocol, '$1') + href; + } else if (href.charAt(0) === '/') { + if (relativeBase) { + return href; + } + + return base.replace(domain, '$1') + href; + } else { + return base + href; + } + } + var noopTest = { + exec: function noopTest() {} + }; + function merge(obj) { + var i = 1, + target, + key; + + for (; i < arguments.length; i++) { + target = arguments[i]; + + for (key in target) { + if (Object.prototype.hasOwnProperty.call(target, key)) { + obj[key] = target[key]; + } + } + } + + return obj; + } + function splitCells(tableRow, count) { + // ensure that every cell-delimiting pipe has a space + // before it to distinguish it from an escaped pipe + var row = tableRow.replace(/\|/g, function (match, offset, str) { + var escaped = false, + curr = offset; + + while (--curr >= 0 && str[curr] === '\\') { + escaped = !escaped; + } + + if (escaped) { + // odd number of slashes means | is escaped + // so we leave it alone + return '|'; + } else { + // add space before unescaped | + return ' |'; + } + }), + cells = row.split(/ \|/); + var i = 0; // First/last cell in a row cannot be empty if it has no leading/trailing pipe + + if (!cells[0].trim()) { + cells.shift(); + } + + if (!cells[cells.length - 1].trim()) { + cells.pop(); + } + + if (cells.length > count) { + cells.splice(count); + } else { + while (cells.length < count) { + cells.push(''); + } + } + + for (; i < cells.length; i++) { + // leading or trailing whitespace is ignored per the gfm spec + cells[i] = cells[i].trim().replace(/\\\|/g, '|'); + } + + return cells; + } // Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). + // /c*$/ is vulnerable to REDOS. + // invert: Remove suffix of non-c chars instead. Default falsey. + + function rtrim(str, c, invert) { + var l = str.length; + + if (l === 0) { + return ''; + } // Length of suffix matching the invert condition. + + + var suffLen = 0; // Step left until we fail to match the invert condition. + + while (suffLen < l) { + var currChar = str.charAt(l - suffLen - 1); + + if (currChar === c && !invert) { + suffLen++; + } else if (currChar !== c && invert) { + suffLen++; + } else { + break; + } + } + + return str.substr(0, l - suffLen); + } + function findClosingBracket(str, b) { + if (str.indexOf(b[1]) === -1) { + return -1; + } + + var l = str.length; + var level = 0, + i = 0; + + for (; i < l; i++) { + if (str[i] === '\\') { + i++; + } else if (str[i] === b[0]) { + level++; + } else if (str[i] === b[1]) { + level--; + + if (level < 0) { + return i; + } + } + } + + return -1; + } + function checkSanitizeDeprecation(opt) { + if (opt && opt.sanitize && !opt.silent) { + console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); + } + } // copied from https://stackoverflow.com/a/5450113/806777 + + function repeatString(pattern, count) { + if (count < 1) { + return ''; + } + + var result = ''; + + while (count > 1) { + if (count & 1) { + result += pattern; + } + + count >>= 1; + pattern += pattern; + } + + return result + pattern; + } + + function outputLink(cap, link, raw, lexer) { + var href = link.href; + var title = link.title ? escape(link.title) : null; + var text = cap[1].replace(/\\([\[\]])/g, '$1'); + + if (cap[0].charAt(0) !== '!') { + lexer.state.inLink = true; + var token = { + type: 'link', + raw: raw, + href: href, + title: title, + text: text, + tokens: lexer.inlineTokens(text, []) + }; + lexer.state.inLink = false; + return token; + } else { + return { + type: 'image', + raw: raw, + href: href, + title: title, + text: escape(text) + }; + } + } + + function indentCodeCompensation(raw, text) { + var matchIndentToCode = raw.match(/^(\s+)(?:```)/); + + if (matchIndentToCode === null) { + return text; + } + + var indentToCode = matchIndentToCode[1]; + return text.split('\n').map(function (node) { + var matchIndentInNode = node.match(/^\s+/); + + if (matchIndentInNode === null) { + return node; + } + + var indentInNode = matchIndentInNode[0]; + + if (indentInNode.length >= indentToCode.length) { + return node.slice(indentToCode.length); + } + + return node; + }).join('\n'); + } + /** + * Tokenizer + */ + + + var Tokenizer = /*#__PURE__*/function () { + function Tokenizer(options) { + this.options = options || exports.defaults; + } + + var _proto = Tokenizer.prototype; + + _proto.space = function space(src) { + var cap = this.rules.block.newline.exec(src); + + if (cap) { + if (cap[0].length > 1) { + return { + type: 'space', + raw: cap[0] + }; + } + + return { + raw: '\n' + }; + } + }; + + _proto.code = function code(src) { + var cap = this.rules.block.code.exec(src); + + if (cap) { + var text = cap[0].replace(/^ {1,4}/gm, ''); + return { + type: 'code', + raw: cap[0], + codeBlockStyle: 'indented', + text: !this.options.pedantic ? rtrim(text, '\n') : text + }; + } + }; + + _proto.fences = function fences(src) { + var cap = this.rules.block.fences.exec(src); + + if (cap) { + var raw = cap[0]; + var text = indentCodeCompensation(raw, cap[3] || ''); + return { + type: 'code', + raw: raw, + lang: cap[2] ? cap[2].trim() : cap[2], + text: text + }; + } + }; + + _proto.heading = function heading(src) { + var cap = this.rules.block.heading.exec(src); + + if (cap) { + var text = cap[2].trim(); // remove trailing #s + + if (/#$/.test(text)) { + var trimmed = rtrim(text, '#'); + + if (this.options.pedantic) { + text = trimmed.trim(); + } else if (!trimmed || / $/.test(trimmed)) { + // CommonMark requires space before trailing #s + text = trimmed.trim(); + } + } + + var token = { + type: 'heading', + raw: cap[0], + depth: cap[1].length, + text: text, + tokens: [] + }; + this.lexer.inline(token.text, token.tokens); + return token; + } + }; + + _proto.hr = function hr(src) { + var cap = this.rules.block.hr.exec(src); + + if (cap) { + return { + type: 'hr', + raw: cap[0] + }; + } + }; + + _proto.blockquote = function blockquote(src) { + var cap = this.rules.block.blockquote.exec(src); + + if (cap) { + var text = cap[0].replace(/^ *> ?/gm, ''); + return { + type: 'blockquote', + raw: cap[0], + tokens: this.lexer.blockTokens(text, []), + text: text + }; + } + }; + + _proto.list = function list(src) { + var cap = this.rules.block.list.exec(src); + + if (cap) { + var raw, istask, ischecked, indent, i, blankLine, endsWithBlankLine, line, lines, itemContents; + var bull = cap[1].trim(); + var isordered = bull.length > 1; + var list = { + type: 'list', + raw: '', + ordered: isordered, + start: isordered ? +bull.slice(0, -1) : '', + loose: false, + items: [] + }; + bull = isordered ? "\\d{1,9}\\" + bull.slice(-1) : "\\" + bull; + + if (this.options.pedantic) { + bull = isordered ? bull : '[*+-]'; + } // Get next list item + + + var itemRegex = new RegExp("^( {0,3}" + bull + ")((?: [^\\n]*| *)(?:\\n[^\\n]*)*(?:\\n|$))"); // Get each top-level item + + while (src) { + if (this.rules.block.hr.test(src)) { + // End list if we encounter an HR (possibly move into itemRegex?) + break; + } + + if (!(cap = itemRegex.exec(src))) { + break; + } + + lines = cap[2].split('\n'); + + if (this.options.pedantic) { + indent = 2; + itemContents = lines[0].trimLeft(); + } else { + indent = cap[2].search(/[^ ]/); // Find first non-space char + + indent = cap[1].length + (indent > 4 ? 1 : indent); // intented code blocks after 4 spaces; indent is always 1 + + itemContents = lines[0].slice(indent - cap[1].length); + } + + blankLine = false; + raw = cap[0]; + + if (!lines[0] && /^ *$/.test(lines[1])) { + // items begin with at most one blank line + raw = cap[1] + lines.slice(0, 2).join('\n') + '\n'; + list.loose = true; + lines = []; + } + + var nextBulletRegex = new RegExp("^ {0," + Math.min(3, indent - 1) + "}(?:[*+-]|\\d{1,9}[.)])"); + + for (i = 1; i < lines.length; i++) { + line = lines[i]; + + if (this.options.pedantic) { + // Re-align to follow commonmark nesting rules + line = line.replace(/^ {1,4}(?=( {4})*[^ ])/g, ' '); + } // End list item if found start of new bullet + + + if (nextBulletRegex.test(line)) { + raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; + break; + } // Until we encounter a blank line, item contents do not need indentation + + + if (!blankLine) { + if (!line.trim()) { + // Check if current line is empty + blankLine = true; + } // Dedent if possible + + + if (line.search(/[^ ]/) >= indent) { + itemContents += '\n' + line.slice(indent); + } else { + itemContents += '\n' + line; + } + + continue; + } // Dedent this line + + + if (line.search(/[^ ]/) >= indent || !line.trim()) { + itemContents += '\n' + line.slice(indent); + continue; + } else { + // Line was not properly indented; end of this item + raw = cap[1] + lines.slice(0, i).join('\n') + '\n'; + break; + } + } + + if (!list.loose) { + // If the previous item ended with a blank line, the list is loose + if (endsWithBlankLine) { + list.loose = true; + } else if (/\n *\n *$/.test(raw)) { + endsWithBlankLine = true; + } + } // Check for task list items + + + if (this.options.gfm) { + istask = /^\[[ xX]\] /.exec(itemContents); + + if (istask) { + ischecked = istask[0] !== '[ ] '; + itemContents = itemContents.replace(/^\[[ xX]\] +/, ''); + } + } + + list.items.push({ + type: 'list_item', + raw: raw, + task: !!istask, + checked: ischecked, + loose: false, + text: itemContents + }); + list.raw += raw; + src = src.slice(raw.length); + } // Do not consume newlines at end of final item. Alternatively, make itemRegex *start* with any newlines to simplify/speed up endsWithBlankLine logic + + + list.items[list.items.length - 1].raw = raw.trimRight(); + list.items[list.items.length - 1].text = itemContents.trimRight(); + list.raw = list.raw.trimRight(); + var l = list.items.length; // Item child tokens handled here at end because we needed to have the final item to trim it first + + for (i = 0; i < l; i++) { + this.lexer.state.top = false; + list.items[i].tokens = this.lexer.blockTokens(list.items[i].text, []); + + if (list.items[i].tokens.some(function (t) { + return t.type === 'space'; + })) { + list.loose = true; + list.items[i].loose = true; + } + } + + return list; + } + }; + + _proto.html = function html(src) { + var cap = this.rules.block.html.exec(src); + + if (cap) { + var token = { + type: 'html', + raw: cap[0], + pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), + text: cap[0] + }; + + if (this.options.sanitize) { + token.type = 'paragraph'; + token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]); + token.tokens = []; + this.lexer.inline(token.text, token.tokens); + } + + return token; + } + }; + + _proto.def = function def(src) { + var cap = this.rules.block.def.exec(src); + + if (cap) { + if (cap[3]) cap[3] = cap[3].substring(1, cap[3].length - 1); + var tag = cap[1].toLowerCase().replace(/\s+/g, ' '); + return { + type: 'def', + tag: tag, + raw: cap[0], + href: cap[2], + title: cap[3] + }; + } + }; + + _proto.table = function table(src) { + var cap = this.rules.block.table.exec(src); + + if (cap) { + var item = { + type: 'table', + header: splitCells(cap[1]).map(function (c) { + return { + text: c + }; + }), + align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), + rows: cap[3] ? cap[3].replace(/\n$/, '').split('\n') : [] + }; + + if (item.header.length === item.align.length) { + item.raw = cap[0]; + var l = item.align.length; + var i, j, k, row; + + for (i = 0; i < l; i++) { + if (/^ *-+: *$/.test(item.align[i])) { + item.align[i] = 'right'; + } else if (/^ *:-+: *$/.test(item.align[i])) { + item.align[i] = 'center'; + } else if (/^ *:-+ *$/.test(item.align[i])) { + item.align[i] = 'left'; + } else { + item.align[i] = null; + } + } + + l = item.rows.length; + + for (i = 0; i < l; i++) { + item.rows[i] = splitCells(item.rows[i], item.header.length).map(function (c) { + return { + text: c + }; + }); + } // parse child tokens inside headers and cells + // header child tokens + + + l = item.header.length; + + for (j = 0; j < l; j++) { + item.header[j].tokens = []; + this.lexer.inlineTokens(item.header[j].text, item.header[j].tokens); + } // cell child tokens + + + l = item.rows.length; + + for (j = 0; j < l; j++) { + row = item.rows[j]; + + for (k = 0; k < row.length; k++) { + row[k].tokens = []; + this.lexer.inlineTokens(row[k].text, row[k].tokens); + } + } + + return item; + } + } + }; + + _proto.lheading = function lheading(src) { + var cap = this.rules.block.lheading.exec(src); + + if (cap) { + var token = { + type: 'heading', + raw: cap[0], + depth: cap[2].charAt(0) === '=' ? 1 : 2, + text: cap[1], + tokens: [] + }; + this.lexer.inline(token.text, token.tokens); + return token; + } + }; + + _proto.paragraph = function paragraph(src) { + var cap = this.rules.block.paragraph.exec(src); + + if (cap) { + var token = { + type: 'paragraph', + raw: cap[0], + text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1], + tokens: [] + }; + this.lexer.inline(token.text, token.tokens); + return token; + } + }; + + _proto.text = function text(src) { + var cap = this.rules.block.text.exec(src); + + if (cap) { + var token = { + type: 'text', + raw: cap[0], + text: cap[0], + tokens: [] + }; + this.lexer.inline(token.text, token.tokens); + return token; + } + }; + + _proto.escape = function escape$1(src) { + var cap = this.rules.inline.escape.exec(src); + + if (cap) { + return { + type: 'escape', + raw: cap[0], + text: escape(cap[1]) + }; + } + }; + + _proto.tag = function tag(src) { + var cap = this.rules.inline.tag.exec(src); + + if (cap) { + if (!this.lexer.state.inLink && /^/i.test(cap[0])) { + this.lexer.state.inLink = false; + } + + if (!this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = true; + } else if (this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(cap[0])) { + this.lexer.state.inRawBlock = false; + } + + return { + type: this.options.sanitize ? 'text' : 'html', + raw: cap[0], + inLink: this.lexer.state.inLink, + inRawBlock: this.lexer.state.inRawBlock, + text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0] + }; + } + }; + + _proto.link = function link(src) { + var cap = this.rules.inline.link.exec(src); + + if (cap) { + var trimmedUrl = cap[2].trim(); + + if (!this.options.pedantic && /^$/.test(trimmedUrl)) { + return; + } // ending angle bracket cannot be escaped + + + var rtrimSlash = rtrim(trimmedUrl.slice(0, -1), '\\'); + + if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { + return; + } + } else { + // find closing parenthesis + var lastParenIndex = findClosingBracket(cap[2], '()'); + + if (lastParenIndex > -1) { + var start = cap[0].indexOf('!') === 0 ? 5 : 4; + var linkLen = start + cap[1].length + lastParenIndex; + cap[2] = cap[2].substring(0, lastParenIndex); + cap[0] = cap[0].substring(0, linkLen).trim(); + cap[3] = ''; + } + } + + var href = cap[2]; + var title = ''; + + if (this.options.pedantic) { + // split pedantic href and title + var link = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(href); + + if (link) { + href = link[1]; + title = link[3]; + } + } else { + title = cap[3] ? cap[3].slice(1, -1) : ''; + } + + href = href.trim(); + + if (/^$/.test(trimmedUrl)) { + // pedantic allows starting angle bracket without ending angle bracket + href = href.slice(1); + } else { + href = href.slice(1, -1); + } + } + + return outputLink(cap, { + href: href ? href.replace(this.rules.inline._escapes, '$1') : href, + title: title ? title.replace(this.rules.inline._escapes, '$1') : title + }, cap[0], this.lexer); + } + }; + + _proto.reflink = function reflink(src, links) { + var cap; + + if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { + var link = (cap[2] || cap[1]).replace(/\s+/g, ' '); + link = links[link.toLowerCase()]; + + if (!link || !link.href) { + var text = cap[0].charAt(0); + return { + type: 'text', + raw: text, + text: text + }; + } + + return outputLink(cap, link, cap[0], this.lexer); + } + }; + + _proto.emStrong = function emStrong(src, maskedSrc, prevChar) { + if (prevChar === void 0) { + prevChar = ''; + } + + var match = this.rules.inline.emStrong.lDelim.exec(src); + if (!match) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well + + if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return; + var nextChar = match[1] || match[2] || ''; + + if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) { + var lLength = match[0].length - 1; + var rDelim, + rLength, + delimTotal = lLength, + midDelimTotal = 0; + var endReg = match[0][0] === '*' ? this.rules.inline.emStrong.rDelimAst : this.rules.inline.emStrong.rDelimUnd; + endReg.lastIndex = 0; // Clip maskedSrc to same section of string as src (move to lexer?) + + maskedSrc = maskedSrc.slice(-1 * src.length + lLength); + + while ((match = endReg.exec(maskedSrc)) != null) { + rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; + if (!rDelim) continue; // skip single * in __abc*abc__ + + rLength = rDelim.length; + + if (match[3] || match[4]) { + // found another Left Delim + delimTotal += rLength; + continue; + } else if (match[5] || match[6]) { + // either Left or Right Delim + if (lLength % 3 && !((lLength + rLength) % 3)) { + midDelimTotal += rLength; + continue; // CommonMark Emphasis Rules 9-10 + } + } + + delimTotal -= rLength; + if (delimTotal > 0) continue; // Haven't found enough closing delimiters + // Remove extra characters. *a*** -> *a* + + rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); // Create `em` if smallest delimiter has odd char count. *a*** + + if (Math.min(lLength, rLength) % 2) { + var _text = src.slice(1, lLength + match.index + rLength); + + return { + type: 'em', + raw: src.slice(0, lLength + match.index + rLength + 1), + text: _text, + tokens: this.lexer.inlineTokens(_text, []) + }; + } // Create 'strong' if smallest delimiter has even char count. **a*** + + + var text = src.slice(2, lLength + match.index + rLength - 1); + return { + type: 'strong', + raw: src.slice(0, lLength + match.index + rLength + 1), + text: text, + tokens: this.lexer.inlineTokens(text, []) + }; + } + } + }; + + _proto.codespan = function codespan(src) { + var cap = this.rules.inline.code.exec(src); + + if (cap) { + var text = cap[2].replace(/\n/g, ' '); + var hasNonSpaceChars = /[^ ]/.test(text); + var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); + + if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { + text = text.substring(1, text.length - 1); + } + + text = escape(text, true); + return { + type: 'codespan', + raw: cap[0], + text: text + }; + } + }; + + _proto.br = function br(src) { + var cap = this.rules.inline.br.exec(src); + + if (cap) { + return { + type: 'br', + raw: cap[0] + }; + } + }; + + _proto.del = function del(src) { + var cap = this.rules.inline.del.exec(src); + + if (cap) { + return { + type: 'del', + raw: cap[0], + text: cap[2], + tokens: this.lexer.inlineTokens(cap[2], []) + }; + } + }; + + _proto.autolink = function autolink(src, mangle) { + var cap = this.rules.inline.autolink.exec(src); + + if (cap) { + var text, href; + + if (cap[2] === '@') { + text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]); + href = 'mailto:' + text; + } else { + text = escape(cap[1]); + href = text; + } + + return { + type: 'link', + raw: cap[0], + text: text, + href: href, + tokens: [{ + type: 'text', + raw: text, + text: text + }] + }; + } + }; + + _proto.url = function url(src, mangle) { + var cap; + + if (cap = this.rules.inline.url.exec(src)) { + var text, href; + + if (cap[2] === '@') { + text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]); + href = 'mailto:' + text; + } else { + // do extended autolink path validation + var prevCapZero; + + do { + prevCapZero = cap[0]; + cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; + } while (prevCapZero !== cap[0]); + + text = escape(cap[0]); + + if (cap[1] === 'www.') { + href = 'http://' + text; + } else { + href = text; + } + } + + return { + type: 'link', + raw: cap[0], + text: text, + href: href, + tokens: [{ + type: 'text', + raw: text, + text: text + }] + }; + } + }; + + _proto.inlineText = function inlineText(src, smartypants) { + var cap = this.rules.inline.text.exec(src); + + if (cap) { + var text; + + if (this.lexer.state.inRawBlock) { + text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]; + } else { + text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); + } + + return { + type: 'text', + raw: cap[0], + text: text + }; + } + }; + + return Tokenizer; + }(); + + /** + * Block-Level Grammar + */ + + var block = { + newline: /^(?: *(?:\n|$))+/, + code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, + fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, + hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, + heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, + blockquote: /^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/, + list: /^( {0,3}bull)( [^\n]+?)?(?:\n|$)/, + html: '^ {0,3}(?:' // optional indentation + + '<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)' // (1) + + '|comment[^\\n]*(\\n+|$)' // (2) + + '|<\\?[\\s\\S]*?(?:\\?>\\n*|$)' // (3) + + '|\\n*|$)' // (4) + + '|\\n*|$)' // (5) + + '|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (6) + + '|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) open tag + + '|(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)' // (7) closing tag + + ')', + def: /^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/, + table: noopTest, + lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, + // regex template, placeholders will be replaced according to different paragraph + // interruption rules of commonmark and the original markdown spec: + _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/, + text: /^[^\n]+/ + }; + block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; + block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; + block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex(); + block.bullet = /(?:[*+-]|\d{1,9}[.)])/; + block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex(); + block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex(); + block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; + block._comment = /|$)/; + block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); + block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs + .replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks + .getRegex(); + block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex(); + /** + * Normal Block Grammar + */ + + block.normal = merge({}, block); + /** + * GFM Block Grammar + */ + + block.gfm = merge({}, block.normal, { + table: '^ *([^\\n ].*\\|.*)\\n' // Header + + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align + + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells + + }); + block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt + .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks + .getRegex(); + /** + * Pedantic grammar (original John Gruber's loose markdown specification) + */ + + block.pedantic = merge({}, block.normal, { + html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)' // closed tag + + '|' + (escaped ? _code : escape(_code, true)) + '
\n';
+ }
+
+ return '' + (escaped ? _code : escape(_code, true)) + '
\n';
+ };
+
+ _proto.blockquote = function blockquote(quote) {
+ return '\n' + quote + '\n'; + }; + + _proto.html = function html(_html) { + return _html; + }; + + _proto.heading = function heading(text, level, raw, slugger) { + if (this.options.headerIds) { + return '
' + text + '
\n'; + }; + + _proto.table = function table(header, body) { + if (body) body = '' + body + ''; + return '' + text + '
';
+ };
+
+ _proto.br = function br() {
+ return this.options.xhtml ? 'An error occurred:
' + escape(e.message + '', true) + ''; + } + + throw e; + } + } + /** + * Options + */ + + marked.options = marked.setOptions = function (opt) { + merge(marked.defaults, opt); + changeDefaults(marked.defaults); + return marked; + }; + + marked.getDefaults = getDefaults; + marked.defaults = exports.defaults; + /** + * Use Extension + */ + + marked.use = function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var opts = merge.apply(void 0, [{}].concat(args)); + var extensions = marked.defaults.extensions || { + renderers: {}, + childTokens: {} + }; + var hasExtensions; + args.forEach(function (pack) { + // ==-- Parse "addon" extensions --== // + if (pack.extensions) { + hasExtensions = true; + pack.extensions.forEach(function (ext) { + if (!ext.name) { + throw new Error('extension name required'); + } + + if (ext.renderer) { + // Renderer extensions + var prevRenderer = extensions.renderers ? extensions.renderers[ext.name] : null; + + if (prevRenderer) { + // Replace extension with func to run new extension but fall back if false + extensions.renderers[ext.name] = function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var ret = ext.renderer.apply(this, args); + + if (ret === false) { + ret = prevRenderer.apply(this, args); + } + + return ret; + }; + } else { + extensions.renderers[ext.name] = ext.renderer; + } + } + + if (ext.tokenizer) { + // Tokenizer Extensions + if (!ext.level || ext.level !== 'block' && ext.level !== 'inline') { + throw new Error("extension level must be 'block' or 'inline'"); + } + + if (extensions[ext.level]) { + extensions[ext.level].unshift(ext.tokenizer); + } else { + extensions[ext.level] = [ext.tokenizer]; + } + + if (ext.start) { + // Function to check for start of token + if (ext.level === 'block') { + if (extensions.startBlock) { + extensions.startBlock.push(ext.start); + } else { + extensions.startBlock = [ext.start]; + } + } else if (ext.level === 'inline') { + if (extensions.startInline) { + extensions.startInline.push(ext.start); + } else { + extensions.startInline = [ext.start]; + } + } + } + } + + if (ext.childTokens) { + // Child tokens to be visited by walkTokens + extensions.childTokens[ext.name] = ext.childTokens; + } + }); + } // ==-- Parse "overwrite" extensions --== // + + + if (pack.renderer) { + (function () { + var renderer = marked.defaults.renderer || new Renderer(); + + var _loop = function _loop(prop) { + var prevRenderer = renderer[prop]; // Replace renderer with func to run extension, but fall back if false + + renderer[prop] = function () { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + var ret = pack.renderer[prop].apply(renderer, args); + + if (ret === false) { + ret = prevRenderer.apply(renderer, args); + } + + return ret; + }; + }; + + for (var prop in pack.renderer) { + _loop(prop); + } + + opts.renderer = renderer; + })(); + } + + if (pack.tokenizer) { + (function () { + var tokenizer = marked.defaults.tokenizer || new Tokenizer(); + + var _loop2 = function _loop2(prop) { + var prevTokenizer = tokenizer[prop]; // Replace tokenizer with func to run extension, but fall back if false + + tokenizer[prop] = function () { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + var ret = pack.tokenizer[prop].apply(tokenizer, args); + + if (ret === false) { + ret = prevTokenizer.apply(tokenizer, args); + } + + return ret; + }; + }; + + for (var prop in pack.tokenizer) { + _loop2(prop); + } + + opts.tokenizer = tokenizer; + })(); + } // ==-- Parse WalkTokens extensions --== // + + + if (pack.walkTokens) { + var _walkTokens = marked.defaults.walkTokens; + + opts.walkTokens = function (token) { + pack.walkTokens.call(this, token); + + if (_walkTokens) { + _walkTokens.call(this, token); + } + }; + } + + if (hasExtensions) { + opts.extensions = extensions; + } + + marked.setOptions(opts); + }); + }; + /** + * Run callback for every token + */ + + + marked.walkTokens = function (tokens, callback) { + var _loop3 = function _loop3() { + var token = _step.value; + callback.call(marked, token); + + switch (token.type) { + case 'table': + { + for (var _iterator2 = _createForOfIteratorHelperLoose(token.header), _step2; !(_step2 = _iterator2()).done;) { + var cell = _step2.value; + marked.walkTokens(cell.tokens, callback); + } + + for (var _iterator3 = _createForOfIteratorHelperLoose(token.rows), _step3; !(_step3 = _iterator3()).done;) { + var row = _step3.value; + + for (var _iterator4 = _createForOfIteratorHelperLoose(row), _step4; !(_step4 = _iterator4()).done;) { + var _cell = _step4.value; + marked.walkTokens(_cell.tokens, callback); + } + } + + break; + } + + case 'list': + { + marked.walkTokens(token.items, callback); + break; + } + + default: + { + if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { + // Walk any extensions + marked.defaults.extensions.childTokens[token.type].forEach(function (childTokens) { + marked.walkTokens(token[childTokens], callback); + }); + } else if (token.tokens) { + marked.walkTokens(token.tokens, callback); + } + } + } + }; + + for (var _iterator = _createForOfIteratorHelperLoose(tokens), _step; !(_step = _iterator()).done;) { + _loop3(); + } + }; + /** + * Parse Inline + */ + + + marked.parseInline = function (src, opt) { + // throw error in case of non string input + if (typeof src === 'undefined' || src === null) { + throw new Error('marked.parseInline(): input parameter is undefined or null'); + } + + if (typeof src !== 'string') { + throw new Error('marked.parseInline(): input parameter is of type ' + Object.prototype.toString.call(src) + ', string expected'); + } + + opt = merge({}, marked.defaults, opt || {}); + checkSanitizeDeprecation(opt); + + try { + var tokens = Lexer.lexInline(src, opt); + + if (opt.walkTokens) { + marked.walkTokens(tokens, opt.walkTokens); + } + + return Parser.parseInline(tokens, opt); + } catch (e) { + e.message += '\nPlease report this to https://github.com/markedjs/marked.'; + + if (opt.silent) { + return '
An error occurred:
' + escape(e.message + '', true) + ''; + } + + throw e; + } + }; + /** + * Expose + */ + + + marked.Parser = Parser; + marked.parser = Parser.parse; + marked.Renderer = Renderer; + marked.TextRenderer = TextRenderer; + marked.Lexer = Lexer; + marked.lexer = Lexer.lex; + marked.Tokenizer = Tokenizer; + marked.Slugger = Slugger; + marked.parse = marked; + var options = marked.options; + var setOptions = marked.setOptions; + var use = marked.use; + var walkTokens = marked.walkTokens; + var parseInline = marked.parseInline; + var parse = marked; + var parser = Parser.parse; + var lexer = Lexer.lex; + + exports.Lexer = Lexer; + exports.Parser = Parser; + exports.Renderer = Renderer; + exports.Slugger = Slugger; + exports.TextRenderer = TextRenderer; + exports.Tokenizer = Tokenizer; + exports.getDefaults = getDefaults; + exports.lexer = lexer; + exports.marked = marked; + exports.options = options; + exports.parse = parse; + exports.parseInline = parseInline; + exports.parser = parser; + exports.setOptions = setOptions; + exports.use = use; + exports.walkTokens = walkTokens; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/lib/marked.esm.js b/lib/marked.esm.js index 23e4d89095..4544a067e0 100644 --- a/lib/marked.esm.js +++ b/lib/marked.esm.js @@ -9,11 +9,7 @@ * The code in this file is generated from files in ./src/ */ -var esmEntry$1 = {exports: {}}; - -var defaults$5 = {exports: {}}; - -function getDefaults$1() { +function getDefaults() { return { baseUrl: null, breaks: false, @@ -37,20 +33,15 @@ function getDefaults$1() { }; } -function changeDefaults$1(newDefaults) { - defaults$5.exports.defaults = newDefaults; -} +let defaults = getDefaults(); -defaults$5.exports = { - defaults: getDefaults$1(), - getDefaults: getDefaults$1, - changeDefaults: changeDefaults$1 -}; +function changeDefaults(newDefaults) { + defaults = newDefaults; +} /** * Helpers */ - const escapeTest = /[&<>"']/; const escapeReplace = /[&<>"']/g; const escapeTestNoEncode = /[<>"']|&(?!#?\w+;)/; @@ -63,7 +54,7 @@ const escapeReplacements = { "'": ''' }; const getEscapeReplacement = (ch) => escapeReplacements[ch]; -function escape$3(html, encode) { +function escape(html, encode) { if (encode) { if (escapeTest.test(html)) { return html.replace(escapeReplace, getEscapeReplacement); @@ -79,7 +70,7 @@ function escape$3(html, encode) { const unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig; -function unescape$1(html) { +function unescape(html) { // explicitly match decimal, hex, and named HTML entities return html.replace(unescapeTest, (_, n) => { n = n.toLowerCase(); @@ -94,7 +85,7 @@ function unescape$1(html) { } const caret = /(^|[^\[])\^/g; -function edit$1(regex, opt) { +function edit(regex, opt) { regex = regex.source || regex; opt = opt || ''; const obj = { @@ -113,11 +104,11 @@ function edit$1(regex, opt) { const nonWordAndColonTest = /[^\w:]/g; const originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i; -function cleanUrl$1(sanitize, base, href) { +function cleanUrl(sanitize, base, href) { if (sanitize) { let prot; try { - prot = decodeURIComponent(unescape$1(href)) + prot = decodeURIComponent(unescape(href)) .replace(nonWordAndColonTest, '') .toLowerCase(); } catch (e) { @@ -151,7 +142,7 @@ function resolveUrl(base, href) { if (justDomain.test(base)) { baseUrls[' ' + base] = base + '/'; } else { - baseUrls[' ' + base] = rtrim$1(base, '/', true); + baseUrls[' ' + base] = rtrim(base, '/', true); } } base = baseUrls[' ' + base]; @@ -172,9 +163,9 @@ function resolveUrl(base, href) { } } -const noopTest$1 = { exec: function noopTest() {} }; +const noopTest = { exec: function noopTest() {} }; -function merge$2(obj) { +function merge(obj) { let i = 1, target, key; @@ -191,7 +182,7 @@ function merge$2(obj) { return obj; } -function splitCells$1(tableRow, count) { +function splitCells(tableRow, count) { // ensure that every cell-delimiting pipe has a space // before it to distinguish it from an escaped pipe const row = tableRow.replace(/\|/g, (match, offset, str) => { @@ -230,7 +221,7 @@ function splitCells$1(tableRow, count) { // Remove trailing 'c's. Equivalent to str.replace(/c*$/, ''). // /c*$/ is vulnerable to REDOS. // invert: Remove suffix of non-c chars instead. Default falsey. -function rtrim$1(str, c, invert) { +function rtrim(str, c, invert) { const l = str.length; if (l === 0) { return ''; @@ -254,7 +245,7 @@ function rtrim$1(str, c, invert) { return str.substr(0, l - suffLen); } -function findClosingBracket$1(str, b) { +function findClosingBracket(str, b) { if (str.indexOf(b[1]) === -1) { return -1; } @@ -276,14 +267,14 @@ function findClosingBracket$1(str, b) { return -1; } -function checkSanitizeDeprecation$1(opt) { +function checkSanitizeDeprecation(opt) { if (opt && opt.sanitize && !opt.silent) { console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options'); } } // copied from https://stackoverflow.com/a/5450113/806777 -function repeatString$1(pattern, count) { +function repeatString(pattern, count) { if (count < 1) { return ''; } @@ -298,32 +289,9 @@ function repeatString$1(pattern, count) { return result + pattern; } -var helpers = { - escape: escape$3, - unescape: unescape$1, - edit: edit$1, - cleanUrl: cleanUrl$1, - resolveUrl, - noopTest: noopTest$1, - merge: merge$2, - splitCells: splitCells$1, - rtrim: rtrim$1, - findClosingBracket: findClosingBracket$1, - checkSanitizeDeprecation: checkSanitizeDeprecation$1, - repeatString: repeatString$1 -}; - -const { defaults: defaults$4 } = defaults$5.exports; -const { - rtrim, - splitCells, - escape: escape$2, - findClosingBracket -} = helpers; - function outputLink(cap, link, raw, lexer) { const href = link.href; - const title = link.title ? escape$2(link.title) : null; + const title = link.title ? escape(link.title) : null; const text = cap[1].replace(/\\([\[\]])/g, '$1'); if (cap[0].charAt(0) !== '!') { @@ -344,7 +312,7 @@ function outputLink(cap, link, raw, lexer) { raw, href, title, - text: escape$2(text) + text: escape(text) }; } } @@ -380,9 +348,9 @@ function indentCodeCompensation(raw, text) { /** * Tokenizer */ -var Tokenizer_1$1 = class Tokenizer { +class Tokenizer { constructor(options) { - this.options = options || defaults$4; + this.options = options || defaults; } space(src) { @@ -641,7 +609,7 @@ var Tokenizer_1$1 = class Tokenizer { }; if (this.options.sanitize) { token.type = 'paragraph'; - token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0]); + token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]); token.tokens = []; this.lexer.inline(token.text, token.tokens); } @@ -771,7 +739,7 @@ var Tokenizer_1$1 = class Tokenizer { return { type: 'escape', raw: cap[0], - text: escape$2(cap[1]) + text: escape(cap[1]) }; } } @@ -800,7 +768,7 @@ var Tokenizer_1$1 = class Tokenizer { text: this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) - : escape$2(cap[0])) + : escape(cap[0])) : cap[0] }; } @@ -955,7 +923,7 @@ var Tokenizer_1$1 = class Tokenizer { if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { text = text.substring(1, text.length - 1); } - text = escape$2(text, true); + text = escape(text, true); return { type: 'codespan', raw: cap[0], @@ -991,10 +959,10 @@ var Tokenizer_1$1 = class Tokenizer { if (cap) { let text, href; if (cap[2] === '@') { - text = escape$2(this.options.mangle ? mangle(cap[1]) : cap[1]); + text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]); href = 'mailto:' + text; } else { - text = escape$2(cap[1]); + text = escape(cap[1]); href = text; } @@ -1019,7 +987,7 @@ var Tokenizer_1$1 = class Tokenizer { if (cap = this.rules.inline.url.exec(src)) { let text, href; if (cap[2] === '@') { - text = escape$2(this.options.mangle ? mangle(cap[0]) : cap[0]); + text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]); href = 'mailto:' + text; } else { // do extended autolink path validation @@ -1028,7 +996,7 @@ var Tokenizer_1$1 = class Tokenizer { prevCapZero = cap[0]; cap[0] = this.rules.inline._backpedal.exec(cap[0])[0]; } while (prevCapZero !== cap[0]); - text = escape$2(cap[0]); + text = escape(cap[0]); if (cap[1] === 'www.') { href = 'http://' + text; } else { @@ -1056,9 +1024,9 @@ var Tokenizer_1$1 = class Tokenizer { if (cap) { let text; if (this.lexer.state.inRawBlock) { - text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape$2(cap[0])) : cap[0]; + text = this.options.sanitize ? (this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0])) : cap[0]; } else { - text = escape$2(this.options.smartypants ? smartypants(cap[0]) : cap[0]); + text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]); } return { type: 'text', @@ -1067,18 +1035,12 @@ var Tokenizer_1$1 = class Tokenizer { }; } } -}; - -const { - noopTest, - edit, - merge: merge$1 -} = helpers; +} /** * Block-Level Grammar */ -const block$1 = { +const block = { newline: /^(?: *(?:\n|$))+/, code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/, @@ -1105,89 +1067,89 @@ const block$1 = { text: /^[^\n]+/ }; -block$1._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; -block$1._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; -block$1.def = edit(block$1.def) - .replace('label', block$1._label) - .replace('title', block$1._title) +block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; +block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/; +block.def = edit(block.def) + .replace('label', block._label) + .replace('title', block._title) .getRegex(); -block$1.bullet = /(?:[*+-]|\d{1,9}[.)])/; -block$1.listItemStart = edit(/^( *)(bull) */) - .replace('bull', block$1.bullet) +block.bullet = /(?:[*+-]|\d{1,9}[.)])/; +block.listItemStart = edit(/^( *)(bull) */) + .replace('bull', block.bullet) .getRegex(); -block$1.list = edit(block$1.list) - .replace(/bull/g, block$1.bullet) +block.list = edit(block.list) + .replace(/bull/g, block.bullet) .replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))') - .replace('def', '\\n+(?=' + block$1.def.source + ')') + .replace('def', '\\n+(?=' + block.def.source + ')') .getRegex(); -block$1._tag = 'address|article|aside|base|basefont|blockquote|body|caption' +block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul'; -block$1._comment = /|$)/; -block$1.html = edit(block$1.html, 'i') - .replace('comment', block$1._comment) - .replace('tag', block$1._tag) +block._comment = /|$)/; +block.html = edit(block.html, 'i') + .replace('comment', block._comment) + .replace('tag', block._tag) .replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/) .getRegex(); -block$1.paragraph = edit(block$1._paragraph) - .replace('hr', block$1.hr) +block.paragraph = edit(block._paragraph) + .replace('hr', block.hr) .replace('heading', ' {0,3}#{1,6} ') .replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs .replace('blockquote', ' {0,3}>') .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)') - .replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks + .replace('tag', block._tag) // pars can be interrupted by type (6) html blocks .getRegex(); -block$1.blockquote = edit(block$1.blockquote) - .replace('paragraph', block$1.paragraph) +block.blockquote = edit(block.blockquote) + .replace('paragraph', block.paragraph) .getRegex(); /** * Normal Block Grammar */ -block$1.normal = merge$1({}, block$1); +block.normal = merge({}, block); /** * GFM Block Grammar */ -block$1.gfm = merge$1({}, block$1.normal, { +block.gfm = merge({}, block.normal, { table: '^ *([^\\n ].*\\|.*)\\n' // Header + ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align + '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells }); -block$1.gfm.table = edit(block$1.gfm.table) - .replace('hr', block$1.hr) +block.gfm.table = edit(block.gfm.table) + .replace('hr', block.hr) .replace('heading', ' {0,3}#{1,6} ') .replace('blockquote', ' {0,3}>') .replace('code', ' {4}[^\\n]') .replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n') .replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)') - .replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks + .replace('tag', block._tag) // tables can be interrupted by type (6) html blocks .getRegex(); /** * Pedantic grammar (original John Gruber's loose markdown specification) */ -block$1.pedantic = merge$1({}, block$1.normal, { +block.pedantic = merge({}, block.normal, { html: edit( '^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)' // closed tag + '|
'
- + (escaped ? code : escape$1(code, true))
+ + (escaped ? code : escape(code, true))
+ '
\n';
}
return ''
- + (escaped ? code : escape$1(code, true))
+ + (escaped ? code : escape(code, true))
+ '
\n';
}
@@ -1992,7 +1938,7 @@ var Renderer_1$1 = class Renderer {
if (href === null) {
return text;
}
- let out = ' {
@@ -2509,11 +2428,11 @@ function marked$1(src, opt, callback) {
}
try {
- const tokens = Lexer$1.lex(src, opt);
+ const tokens = Lexer.lex(src, opt);
if (opt.walkTokens) {
- marked$1.walkTokens(tokens, opt.walkTokens);
+ marked.walkTokens(tokens, opt.walkTokens);
}
- return Parser$1.parse(tokens, opt);
+ return Parser.parse(tokens, opt);
} catch (e) {
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
if (opt.silent) {
@@ -2529,24 +2448,24 @@ function marked$1(src, opt, callback) {
* Options
*/
-marked$1.options =
-marked$1.setOptions = function(opt) {
- merge(marked$1.defaults, opt);
- changeDefaults(marked$1.defaults);
- return marked$1;
+marked.options =
+marked.setOptions = function(opt) {
+ merge(marked.defaults, opt);
+ changeDefaults(marked.defaults);
+ return marked;
};
-marked$1.getDefaults = getDefaults;
+marked.getDefaults = getDefaults;
-marked$1.defaults = defaults;
+marked.defaults = defaults;
/**
* Use Extension
*/
-marked$1.use = function(...args) {
+marked.use = function(...args) {
const opts = merge({}, ...args);
- const extensions = marked$1.defaults.extensions || { renderers: {}, childTokens: {} };
+ const extensions = marked.defaults.extensions || { renderers: {}, childTokens: {} };
let hasExtensions;
args.forEach((pack) => {
@@ -2605,7 +2524,7 @@ marked$1.use = function(...args) {
// ==-- Parse "overwrite" extensions --== //
if (pack.renderer) {
- const renderer = marked$1.defaults.renderer || new Renderer$1();
+ const renderer = marked.defaults.renderer || new Renderer();
for (const prop in pack.renderer) {
const prevRenderer = renderer[prop];
// Replace renderer with func to run extension, but fall back if false
@@ -2620,7 +2539,7 @@ marked$1.use = function(...args) {
opts.renderer = renderer;
}
if (pack.tokenizer) {
- const tokenizer = marked$1.defaults.tokenizer || new Tokenizer$1();
+ const tokenizer = marked.defaults.tokenizer || new Tokenizer();
for (const prop in pack.tokenizer) {
const prevTokenizer = tokenizer[prop];
// Replace tokenizer with func to run extension, but fall back if false
@@ -2637,7 +2556,7 @@ marked$1.use = function(...args) {
// ==-- Parse WalkTokens extensions --== //
if (pack.walkTokens) {
- const walkTokens = marked$1.defaults.walkTokens;
+ const walkTokens = marked.defaults.walkTokens;
opts.walkTokens = function(token) {
pack.walkTokens.call(this, token);
if (walkTokens) {
@@ -2650,7 +2569,7 @@ marked$1.use = function(...args) {
opts.extensions = extensions;
}
- marked$1.setOptions(opts);
+ marked.setOptions(opts);
});
};
@@ -2658,32 +2577,32 @@ marked$1.use = function(...args) {
* Run callback for every token
*/
-marked$1.walkTokens = function(tokens, callback) {
+marked.walkTokens = function(tokens, callback) {
for (const token of tokens) {
- callback.call(marked$1, token);
+ callback.call(marked, token);
switch (token.type) {
case 'table': {
for (const cell of token.header) {
- marked$1.walkTokens(cell.tokens, callback);
+ marked.walkTokens(cell.tokens, callback);
}
for (const row of token.rows) {
for (const cell of row) {
- marked$1.walkTokens(cell.tokens, callback);
+ marked.walkTokens(cell.tokens, callback);
}
}
break;
}
case 'list': {
- marked$1.walkTokens(token.items, callback);
+ marked.walkTokens(token.items, callback);
break;
}
default: {
- if (marked$1.defaults.extensions && marked$1.defaults.extensions.childTokens && marked$1.defaults.extensions.childTokens[token.type]) { // Walk any extensions
- marked$1.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {
- marked$1.walkTokens(token[childTokens], callback);
+ if (marked.defaults.extensions && marked.defaults.extensions.childTokens && marked.defaults.extensions.childTokens[token.type]) { // Walk any extensions
+ marked.defaults.extensions.childTokens[token.type].forEach(function(childTokens) {
+ marked.walkTokens(token[childTokens], callback);
});
} else if (token.tokens) {
- marked$1.walkTokens(token.tokens, callback);
+ marked.walkTokens(token.tokens, callback);
}
}
}
@@ -2693,7 +2612,7 @@ marked$1.walkTokens = function(tokens, callback) {
/**
* Parse Inline
*/
-marked$1.parseInline = function(src, opt) {
+marked.parseInline = function(src, opt) {
// throw error in case of non string input
if (typeof src === 'undefined' || src === null) {
throw new Error('marked.parseInline(): input parameter is undefined or null');
@@ -2703,15 +2622,15 @@ marked$1.parseInline = function(src, opt) {
+ Object.prototype.toString.call(src) + ', string expected');
}
- opt = merge({}, marked$1.defaults, opt || {});
+ opt = merge({}, marked.defaults, opt || {});
checkSanitizeDeprecation(opt);
try {
- const tokens = Lexer$1.lexInline(src, opt);
+ const tokens = Lexer.lexInline(src, opt);
if (opt.walkTokens) {
- marked$1.walkTokens(tokens, opt.walkTokens);
+ marked.walkTokens(tokens, opt.walkTokens);
}
- return Parser$1.parseInline(tokens, opt);
+ return Parser.parseInline(tokens, opt);
} catch (e) {
e.message += '\nPlease report this to https://github.com/markedjs/marked.';
if (opt.silent) {
@@ -2726,37 +2645,23 @@ marked$1.parseInline = function(src, opt) {
/**
* Expose
*/
-marked$1.Parser = Parser$1;
-marked$1.parser = Parser$1.parse;
-marked$1.Renderer = Renderer$1;
-marked$1.TextRenderer = TextRenderer$1;
-marked$1.Lexer = Lexer$1;
-marked$1.lexer = Lexer$1.lex;
-marked$1.Tokenizer = Tokenizer$1;
-marked$1.Slugger = Slugger$1;
-marked$1.parse = marked$1;
-
-var marked_1 = marked$1;
-
-const marked = marked_1;
-const Lexer = Lexer_1$1;
-const Parser = Parser_1$1;
-const Tokenizer = Tokenizer_1$1;
-const Renderer = Renderer_1$1;
-const TextRenderer = TextRenderer_1$1;
-const Slugger = Slugger_1$1;
-
-esmEntry$1.exports = marked;
-var parse = esmEntry$1.exports.parse = marked;
-var Parser_1 = esmEntry$1.exports.Parser = Parser;
-var parser = esmEntry$1.exports.parser = Parser.parse;
-var Renderer_1 = esmEntry$1.exports.Renderer = Renderer;
-var TextRenderer_1 = esmEntry$1.exports.TextRenderer = TextRenderer;
-var Lexer_1 = esmEntry$1.exports.Lexer = Lexer;
-var lexer = esmEntry$1.exports.lexer = Lexer.lex;
-var Tokenizer_1 = esmEntry$1.exports.Tokenizer = Tokenizer;
-var Slugger_1 = esmEntry$1.exports.Slugger = Slugger;
-
-var esmEntry = esmEntry$1.exports;
-
-export { Lexer_1 as Lexer, Parser_1 as Parser, Renderer_1 as Renderer, Slugger_1 as Slugger, TextRenderer_1 as TextRenderer, Tokenizer_1 as Tokenizer, esmEntry as default, lexer, parse, parser };
+marked.Parser = Parser;
+marked.parser = Parser.parse;
+marked.Renderer = Renderer;
+marked.TextRenderer = TextRenderer;
+marked.Lexer = Lexer;
+marked.lexer = Lexer.lex;
+marked.Tokenizer = Tokenizer;
+marked.Slugger = Slugger;
+marked.parse = marked;
+
+const options = marked.options;
+const setOptions = marked.setOptions;
+const use = marked.use;
+const walkTokens = marked.walkTokens;
+const parseInline = marked.parseInline;
+const parse = marked;
+const parser = Parser.parse;
+const lexer = Lexer.lex;
+
+export { Lexer, Parser, Renderer, Slugger, TextRenderer, Tokenizer, defaults, getDefaults, lexer, marked, options, parse, parseInline, parser, setOptions, use, walkTokens };
diff --git a/lib/marked.js b/lib/marked.js
index d290cfdb82..2f0718356c 100644
--- a/lib/marked.js
+++ b/lib/marked.js
@@ -10,10 +10,10 @@
*/
(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define(factory) :
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.marked = factory());
-})(this, (function () { 'use strict';
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.marked = {}));
+})(this, (function (exports) { 'use strict';
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
@@ -69,9 +69,7 @@
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
- var defaults$5 = {exports: {}};
-
- function getDefaults$1() {
+ function getDefaults() {
return {
baseUrl: null,
breaks: false,
@@ -94,17 +92,11 @@
xhtml: false
};
}
-
- function changeDefaults$1(newDefaults) {
- defaults$5.exports.defaults = newDefaults;
+ exports.defaults = getDefaults();
+ function changeDefaults(newDefaults) {
+ exports.defaults = newDefaults;
}
- defaults$5.exports = {
- defaults: getDefaults$1(),
- getDefaults: getDefaults$1,
- changeDefaults: changeDefaults$1
- };
-
/**
* Helpers
*/
@@ -124,7 +116,7 @@
return escapeReplacements[ch];
};
- function escape$2(html, encode) {
+ function escape(html, encode) {
if (encode) {
if (escapeTest.test(html)) {
return html.replace(escapeReplace, getEscapeReplacement);
@@ -137,10 +129,8 @@
return html;
}
-
var unescapeTest = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
-
- function unescape$1(html) {
+ function unescape(html) {
// explicitly match decimal, hex, and named HTML entities
return html.replace(unescapeTest, function (_, n) {
n = n.toLowerCase();
@@ -153,10 +143,8 @@
return '';
});
}
-
var caret = /(^|[^\[])\^/g;
-
- function edit$1(regex, opt) {
+ function edit(regex, opt) {
regex = regex.source || regex;
opt = opt || '';
var obj = {
@@ -172,16 +160,14 @@
};
return obj;
}
-
var nonWordAndColonTest = /[^\w:]/g;
var originIndependentUrl = /^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;
-
- function cleanUrl$1(sanitize, base, href) {
+ function cleanUrl(sanitize, base, href) {
if (sanitize) {
var prot;
try {
- prot = decodeURIComponent(unescape$1(href)).replace(nonWordAndColonTest, '').toLowerCase();
+ prot = decodeURIComponent(unescape(href)).replace(nonWordAndColonTest, '').toLowerCase();
} catch (e) {
return null;
}
@@ -203,12 +189,10 @@
return href;
}
-
var baseUrls = {};
var justDomain = /^[^:]+:\/*[^/]*$/;
var protocol = /^([^:]+:)[\s\S]*$/;
var domain = /^([^:]+:\/*[^/]*)[\s\S]*$/;
-
function resolveUrl(base, href) {
if (!baseUrls[' ' + base]) {
// we can ignore everything in base after the last slash of its path component,
@@ -217,7 +201,7 @@
if (justDomain.test(base)) {
baseUrls[' ' + base] = base + '/';
} else {
- baseUrls[' ' + base] = rtrim$1(base, '/', true);
+ baseUrls[' ' + base] = rtrim(base, '/', true);
}
}
@@ -240,12 +224,10 @@
return base + href;
}
}
-
- var noopTest$1 = {
+ var noopTest = {
exec: function noopTest() {}
};
-
- function merge$2(obj) {
+ function merge(obj) {
var i = 1,
target,
key;
@@ -262,8 +244,7 @@
return obj;
}
-
- function splitCells$1(tableRow, count) {
+ function splitCells(tableRow, count) {
// ensure that every cell-delimiting pipe has a space
// before it to distinguish it from an escaped pipe
var row = tableRow.replace(/\|/g, function (match, offset, str) {
@@ -312,8 +293,7 @@
// /c*$/ is vulnerable to REDOS.
// invert: Remove suffix of non-c chars instead. Default falsey.
-
- function rtrim$1(str, c, invert) {
+ function rtrim(str, c, invert) {
var l = str.length;
if (l === 0) {
@@ -337,8 +317,7 @@
return str.substr(0, l - suffLen);
}
-
- function findClosingBracket$1(str, b) {
+ function findClosingBracket(str, b) {
if (str.indexOf(b[1]) === -1) {
return -1;
}
@@ -363,15 +342,13 @@
return -1;
}
-
- function checkSanitizeDeprecation$1(opt) {
+ function checkSanitizeDeprecation(opt) {
if (opt && opt.sanitize && !opt.silent) {
console.warn('marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options');
}
} // copied from https://stackoverflow.com/a/5450113/806777
-
- function repeatString$1(pattern, count) {
+ function repeatString(pattern, count) {
if (count < 1) {
return '';
}
@@ -390,30 +367,9 @@
return result + pattern;
}
- var helpers = {
- escape: escape$2,
- unescape: unescape$1,
- edit: edit$1,
- cleanUrl: cleanUrl$1,
- resolveUrl: resolveUrl,
- noopTest: noopTest$1,
- merge: merge$2,
- splitCells: splitCells$1,
- rtrim: rtrim$1,
- findClosingBracket: findClosingBracket$1,
- checkSanitizeDeprecation: checkSanitizeDeprecation$1,
- repeatString: repeatString$1
- };
-
- var defaults$4 = defaults$5.exports.defaults;
- var rtrim = helpers.rtrim,
- splitCells = helpers.splitCells,
- _escape = helpers.escape,
- findClosingBracket = helpers.findClosingBracket;
-
function outputLink(cap, link, raw, lexer) {
var href = link.href;
- var title = link.title ? _escape(link.title) : null;
+ var title = link.title ? escape(link.title) : null;
var text = cap[1].replace(/\\([\[\]])/g, '$1');
if (cap[0].charAt(0) !== '!') {
@@ -434,7 +390,7 @@
raw: raw,
href: href,
title: title,
- text: _escape(text)
+ text: escape(text)
};
}
}
@@ -468,9 +424,9 @@
*/
- var Tokenizer_1 = /*#__PURE__*/function () {
+ var Tokenizer = /*#__PURE__*/function () {
function Tokenizer(options) {
- this.options = options || defaults$4;
+ this.options = options || exports.defaults;
}
var _proto = Tokenizer.prototype;
@@ -742,7 +698,7 @@
if (this.options.sanitize) {
token.type = 'paragraph';
- token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]);
+ token.text = this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]);
token.tokens = [];
this.lexer.inline(token.text, token.tokens);
}
@@ -881,14 +837,14 @@
}
};
- _proto.escape = function escape(src) {
+ _proto.escape = function escape$1(src) {
var cap = this.rules.inline.escape.exec(src);
if (cap) {
return {
type: 'escape',
raw: cap[0],
- text: _escape(cap[1])
+ text: escape(cap[1])
};
}
};
@@ -914,7 +870,7 @@
raw: cap[0],
inLink: this.lexer.state.inLink,
inRawBlock: this.lexer.state.inRawBlock,
- text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0]
+ text: this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0]
};
}
};
@@ -1011,7 +967,7 @@
var match = this.rules.inline.emStrong.lDelim.exec(src);
if (!match) return; // _ can't be between two alphanumerics. \p{L}\p{N} includes non-english alphabet/numbers as well
- if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return;
+ if (match[3] && prevChar.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/)) return;
var nextChar = match[1] || match[2] || '';
if (!nextChar || nextChar && (prevChar === '' || this.rules.inline.punctuation.exec(prevChar))) {
@@ -1084,7 +1040,7 @@
text = text.substring(1, text.length - 1);
}
- text = _escape(text, true);
+ text = escape(text, true);
return {
type: 'codespan',
raw: cap[0],
@@ -1124,10 +1080,10 @@
var text, href;
if (cap[2] === '@') {
- text = _escape(this.options.mangle ? mangle(cap[1]) : cap[1]);
+ text = escape(this.options.mangle ? mangle(cap[1]) : cap[1]);
href = 'mailto:' + text;
} else {
- text = _escape(cap[1]);
+ text = escape(cap[1]);
href = text;
}
@@ -1152,7 +1108,7 @@
var text, href;
if (cap[2] === '@') {
- text = _escape(this.options.mangle ? mangle(cap[0]) : cap[0]);
+ text = escape(this.options.mangle ? mangle(cap[0]) : cap[0]);
href = 'mailto:' + text;
} else {
// do extended autolink path validation
@@ -1163,7 +1119,7 @@
cap[0] = this.rules.inline._backpedal.exec(cap[0])[0];
} while (prevCapZero !== cap[0]);
- text = _escape(cap[0]);
+ text = escape(cap[0]);
if (cap[1] === 'www.') {
href = 'http://' + text;
@@ -1193,9 +1149,9 @@
var text;
if (this.lexer.state.inRawBlock) {
- text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : _escape(cap[0]) : cap[0];
+ text = this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0];
} else {
- text = _escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
+ text = escape(this.options.smartypants ? smartypants(cap[0]) : cap[0]);
}
return {
@@ -1209,14 +1165,11 @@
return Tokenizer;
}();
- var noopTest = helpers.noopTest,
- edit = helpers.edit,
- merge$1 = helpers.merge;
/**
* Block-Level Grammar
*/
- var block$1 = {
+ var block = {
newline: /^(?: *(?:\n|$))+/,
code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,
fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,
@@ -1242,56 +1195,56 @@
_paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,
text: /^[^\n]+/
};
- block$1._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
- block$1._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
- block$1.def = edit(block$1.def).replace('label', block$1._label).replace('title', block$1._title).getRegex();
- block$1.bullet = /(?:[*+-]|\d{1,9}[.)])/;
- block$1.listItemStart = edit(/^( *)(bull) */).replace('bull', block$1.bullet).getRegex();
- block$1.list = edit(block$1.list).replace(/bull/g, block$1.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block$1.def.source + ')').getRegex();
- block$1._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
- block$1._comment = /|$)/;
- block$1.html = edit(block$1.html, 'i').replace('comment', block$1._comment).replace('tag', block$1._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
- block$1.paragraph = edit(block$1._paragraph).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
+ block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
+ block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
+ block.def = edit(block.def).replace('label', block._label).replace('title', block._title).getRegex();
+ block.bullet = /(?:[*+-]|\d{1,9}[.)])/;
+ block.listItemStart = edit(/^( *)(bull) */).replace('bull', block.bullet).getRegex();
+ block.list = edit(block.list).replace(/bull/g, block.bullet).replace('hr', '\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))').replace('def', '\\n+(?=' + block.def.source + ')').getRegex();
+ block._tag = 'address|article|aside|base|basefont|blockquote|body|caption' + '|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption' + '|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe' + '|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option' + '|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr' + '|track|ul';
+ block._comment = /|$)/;
+ block.html = edit(block.html, 'i').replace('comment', block._comment).replace('tag', block._tag).replace('attribute', / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();
+ block.paragraph = edit(block._paragraph).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('|lheading', '') // setex headings don't interrupt commonmark paragraphs
.replace('blockquote', ' {0,3}>').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
- .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // pars can be interrupted by type (6) html blocks
+ .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // pars can be interrupted by type (6) html blocks
.getRegex();
- block$1.blockquote = edit(block$1.blockquote).replace('paragraph', block$1.paragraph).getRegex();
+ block.blockquote = edit(block.blockquote).replace('paragraph', block.paragraph).getRegex();
/**
* Normal Block Grammar
*/
- block$1.normal = merge$1({}, block$1);
+ block.normal = merge({}, block);
/**
* GFM Block Grammar
*/
- block$1.gfm = merge$1({}, block$1.normal, {
+ block.gfm = merge({}, block.normal, {
table: '^ *([^\\n ].*\\|.*)\\n' // Header
+ ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?' // Align
+ '(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)' // Cells
});
- block$1.gfm.table = edit(block$1.gfm.table).replace('hr', block$1.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
- .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block$1._tag) // tables can be interrupted by type (6) html blocks
+ block.gfm.table = edit(block.gfm.table).replace('hr', block.hr).replace('heading', ' {0,3}#{1,6} ').replace('blockquote', ' {0,3}>').replace('code', ' {4}[^\\n]').replace('fences', ' {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n').replace('list', ' {0,3}(?:[*+-]|1[.)]) ') // only lists starting from 1 can interrupt
+ .replace('html', '?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)').replace('tag', block._tag) // tables can be interrupted by type (6) html blocks
.getRegex();
/**
* Pedantic grammar (original John Gruber's loose markdown specification)
*/
- block$1.pedantic = merge$1({}, block$1.normal, {
+ block.pedantic = merge({}, block.normal, {
html: edit('^ *(?:comment *(?:\\n|\\s*$)' + '|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)' // closed tag
- + '|' + (escaped ? _code : escape$1(_code, true)) + '
\n';
+ return '' + (escaped ? _code : escape(_code, true)) + '
\n';
}
- return '' + (escaped ? _code : escape$1(_code, true)) + '
\n';
+ return '' + (escaped ? _code : escape(_code, true)) + '
\n';
};
_proto.blockquote = function blockquote(quote) {
@@ -2070,7 +2011,7 @@
return text;
}
- var out = '\fP] [\-i \fI\fP] [\-\-help]
+[\-o \fI