From 6ccd21860fe57acf085557d761e4f1ef17222bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20J=C3=B3zsef=20J=C3=A1nv=C3=A1ri?= <4534880+dzsibi@users.noreply.github.com> Date: Fri, 17 Feb 2023 19:36:19 +0100 Subject: [PATCH 1/2] Update marked to 4.2.12 --- package-lock.json | 18 +++++++++--------- package.json | 2 +- src/core/global-api.js | 2 +- src/core/render/compiler.js | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index a9d7fcf5d..d1ae4b279 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "marked": "^1.2.9", + "marked": "^4.2.12", "medium-zoom": "^1.0.8", "opencollective-postinstall": "^2.0.2", "prismjs": "^1.29.0", @@ -16245,14 +16245,14 @@ } }, "node_modules/marked": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.9.tgz", - "integrity": "sha512-H8lIX2SvyitGX+TRdtS06m1jHMijKN/XjfH6Ooii9fvxMlh8QdqBfBDkGUpMWH2kQNrtixjzYUa3SH8ROTgRRw==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", + "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", "bin": { - "marked": "bin/marked" + "marked": "bin/marked.js" }, "engines": { - "node": ">= 8.16.2" + "node": ">= 12" } }, "node_modules/mdn-data": { @@ -35934,9 +35934,9 @@ } }, "marked": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/marked/-/marked-1.2.9.tgz", - "integrity": "sha512-H8lIX2SvyitGX+TRdtS06m1jHMijKN/XjfH6Ooii9fvxMlh8QdqBfBDkGUpMWH2kQNrtixjzYUa3SH8ROTgRRw==" + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", + "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==" }, "mdn-data": { "version": "2.0.4", diff --git a/package.json b/package.json index 524de5592..938c9b420 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "*.js": "eslint --fix" }, "dependencies": { - "marked": "^1.2.9", + "marked": "^4.2.12", "medium-zoom": "^1.0.8", "opencollective-postinstall": "^2.0.2", "prismjs": "^1.29.0", diff --git a/src/core/global-api.js b/src/core/global-api.js index 536959754..cb89e2bee 100644 --- a/src/core/global-api.js +++ b/src/core/global-api.js @@ -1,5 +1,5 @@ import prism from 'prismjs'; -import marked from 'marked'; +import { marked } from 'marked'; import * as util from './util'; import * as dom from './util/dom'; import { Compiler } from './render/compiler'; diff --git a/src/core/render/compiler.js b/src/core/render/compiler.js index 255c49642..e77db19ac 100644 --- a/src/core/render/compiler.js +++ b/src/core/render/compiler.js @@ -1,4 +1,4 @@ -import marked from 'marked'; +import { marked } from 'marked'; import { isAbsolutePath, getPath, getParentPath } from '../router/util'; import { isFn, merge, cached, isPrimitive } from '../util/core'; import { tree as treeTpl } from './tpl'; From 5180458b74847cbe10b463aa2f9e311ad1463c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20J=C3=B3zsef=20J=C3=A1nv=C3=A1ri?= <4534880+dzsibi@users.noreply.github.com> Date: Mon, 20 Feb 2023 16:12:30 +0100 Subject: [PATCH 2/2] FIx broken table search due marked lexer changes --- src/plugins/search/search.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/plugins/search/search.js b/src/plugins/search/search.js index f8d7cd3ab..88f9f1a4e 100644 --- a/src/plugins/search/search.js +++ b/src/plugins/search/search.js @@ -57,11 +57,9 @@ function getAllPaths(router) { function getTableData(token) { if (!token.text && token.type === 'table') { - token.cells.unshift(token.header); - token.text = token.cells - .map(function (rows) { - return rows.join(' | '); - }) + token.rows.unshift(token.header); + token.text = token.rows + .map(columns => columns.map(r => r.text).join(' | ')) .join(' |\n '); } return token.text;