[Pkg-javascript-commits] [Git][js-team/node-marked][upstream] New upstream version 4.0.12+ds+~4.0.1
Yadd (@yadd)
gitlab at salsa.debian.org
Fri Jan 28 14:59:20 GMT 2022
Yadd pushed to branch upstream at Debian JavaScript Maintainers / node-marked
Commits:
6a29623c by Yadd at 2022-01-28T15:46:15+01:00
New upstream version 4.0.12+ds+~4.0.1
- - - - -
13 changed files:
- README.md
- package-lock.json
- package.json
- src/Tokenizer.js
- src/helpers.js
- src/rules.js
- + test/specs/new/nbsp_following_tables.html
- + test/specs/new/nbsp_following_tables.md
- test/specs/new/tab_newline.html
- test/specs/new/tab_newline.md
- + test/specs/redos/cubic_def.cjs
- + test/specs/redos/reflink_redos.html
- + test/specs/redos/reflink_redos.md
Changes:
=====================================
README.md
=====================================
@@ -84,4 +84,4 @@ $ marked --help
## License
-Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
+Copyright (c) 2011-2022, Christopher Jeffrey. (MIT License)
=====================================
package-lock.json
=====================================
The diff for this file was not included because it is too large.
=====================================
package.json
=====================================
@@ -2,7 +2,7 @@
"name": "marked",
"description": "A markdown parser built for speed",
"author": "Christopher Jeffrey",
- "version": "4.0.9",
+ "version": "4.0.12",
"type": "module",
"main": "./lib/marked.cjs",
"module": "./lib/marked.esm.js",
@@ -42,8 +42,8 @@
"html"
],
"devDependencies": {
- "@babel/core": "^7.16.7",
- "@babel/preset-env": "^7.16.5",
+ "@babel/core": "^7.16.12",
+ "@babel/preset-env": "^7.16.11",
"@markedjs/html-differ": "^4.0.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
@@ -54,19 +54,19 @@
"@semantic-release/release-notes-generator": "^10.0.3",
"cheerio": "^1.0.0-rc.10",
"commonmark": "0.30.0",
- "eslint": "^8.6.0",
+ "eslint": "^8.7.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.0.0",
"front-matter": "^4.0.2",
- "highlight.js": "^11.3.1",
- "jasmine": "^4.0.0",
- "markdown-it": "12.3.0",
- "node-fetch": "^3.1.0",
- "rollup": "^2.62.0",
+ "highlight.js": "^11.4.0",
+ "jasmine": "^4.0.2",
+ "markdown-it": "12.3.2",
+ "node-fetch": "^3.2.0",
+ "rollup": "^2.66.0",
"rollup-plugin-license": "^2.6.1",
- "semantic-release": "^18.0.1",
+ "semantic-release": "^19.0.2",
"titleize": "^3.0.0",
"uglify-js": "^3.14.5",
"vuln-regex-detector": "^1.3.0"
=====================================
src/Tokenizer.js
=====================================
@@ -369,7 +369,7 @@ export class Tokenizer {
type: 'table',
header: splitCells(cap[1]).map(c => { return { text: c }; }),
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
- rows: cap[3] ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
+ rows: cap[3] && cap[3].trim() ? cap[3].replace(/\n[ \t]*$/, '').split('\n') : []
};
if (item.header.length === item.align.length) {
=====================================
src/helpers.js
=====================================
@@ -162,7 +162,7 @@ export function splitCells(tableRow, count) {
// 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 > 0 && !cells[cells.length - 1].trim()) { cells.pop(); }
if (cells.length > count) {
cells.splice(count);
=====================================
src/rules.js
=====================================
@@ -25,7 +25,7 @@ export const block = {
+ '|<(?!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+|$)/,
+ 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
@@ -34,7 +34,7 @@ export const block = {
text: /^[^\n]+/
};
-block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;
+block._label = /(?!\s*\])(?:\\.|[^\[\]\\])+/;
block._title = /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;
block.def = edit(block.def)
.replace('label', block._label)
@@ -162,8 +162,8 @@ export const inline = {
+ '|^<![a-zA-Z]+\\s[\\s\\S]*?>' // declaration, e.g. <!DOCTYPE html>
+ '|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>', // CDATA section
link: /^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,
- reflink: /^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,
- nolink: /^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,
+ reflink: /^!?\[(label)\]\[(ref)\]/,
+ nolink: /^!?\[(ref)\](?:\[\])?/,
reflinkSearch: 'reflink|nolink(?!\\()',
emStrong: {
lDelim: /^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,
@@ -230,6 +230,11 @@ inline.link = edit(inline.link)
inline.reflink = edit(inline.reflink)
.replace('label', inline._label)
+ .replace('ref', block._label)
+ .getRegex();
+
+inline.nolink = edit(inline.nolink)
+ .replace('ref', block._label)
.getRegex();
inline.reflinkSearch = edit(inline.reflinkSearch, 'g')
=====================================
test/specs/new/nbsp_following_tables.html
=====================================
@@ -0,0 +1,22 @@
+<table>
+ <thead>
+ <tr>
+ <th>abc</th>
+ <th>def</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>bar</td>
+ <td>foo</td>
+ </tr>
+ <tr>
+ <td>baz</td>
+ <td>boo</td>
+ </tr>
+ <tr>
+ <td></td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
=====================================
test/specs/new/nbsp_following_tables.md
=====================================
@@ -0,0 +1,5 @@
+| abc | def |
+| --- | --- |
+| bar | foo |
+| baz | boo |
+
=====================================
test/specs/new/tab_newline.html
=====================================
@@ -36,3 +36,10 @@
</table>
<pre><code>code
</code></pre>
+<table>
+ <thead>
+ <tr>
+ <th>y</th>
+ </tr>
+ </thead>
+</table>
=====================================
test/specs/new/tab_newline.md
=====================================
@@ -9,4 +9,7 @@
| y |
| - |
| x |
- code
\ No newline at end of file
+ code
+| y |
+| - |
+
\ No newline at end of file
=====================================
test/specs/redos/cubic_def.cjs
=====================================
@@ -0,0 +1,4 @@
+module.exports = {
+ markdown: `[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x`,
+ html: `<p>[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x</p>`,
+};
=====================================
test/specs/redos/reflink_redos.html
=====================================
@@ -0,0 +1 @@
+<p>[[]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([]([</p>
=====================================
test/specs/redos/reflink_redos.md
=====================================
@@ -0,0 +1,3 @@
+[x]: x
+
+[\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\](\[\]([
View it on GitLab: https://salsa.debian.org/js-team/node-marked/-/commit/6a29623cc6471b914149cd67a9ada876d72e0577
--
View it on GitLab: https://salsa.debian.org/js-team/node-marked/-/commit/6a29623cc6471b914149cd67a9ada876d72e0577
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-commits/attachments/20220128/d40d6a9f/attachment-0001.htm>
More information about the Pkg-javascript-commits
mailing list