From 02f6e1820be1335b928c2443e124a5373e033c85 Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Thu, 17 Jan 2019 11:06:35 +0100 Subject: [PATCH] chore: update marked to version 0.6.0 (#768) The new release includes https://github.com/markedjs/marked/pull/1383. --- package.json | 4 ++-- src/services/MarkdownRenderer.ts | 4 ++-- yarn.lock | 15 ++++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index a0c7d833..bed89117 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@types/lodash": "^4.14.118", "@types/lunr": "^2.1.6", "@types/mark.js": "^8.11.1", - "@types/marked": "^0.4.2", + "@types/marked": "^0.6.0", "@types/prismjs": "^1.6.4", "@types/prop-types": "^15.5.6", "@types/react": "^16.7.7", @@ -139,7 +139,7 @@ "json-schema-ref-parser": "^6.0.1", "lunr": "^2.3.2", "mark.js": "^8.11.1", - "marked": "^0.5.2", + "marked": "^0.6.0", "memoize-one": "^4.0.0", "mobx-react": "^5.2.5", "openapi-sampler": "1.0.0-beta.14", diff --git a/src/services/MarkdownRenderer.ts b/src/services/MarkdownRenderer.ts index a944dac3..0e08c6c4 100644 --- a/src/services/MarkdownRenderer.ts +++ b/src/services/MarkdownRenderer.ts @@ -118,7 +118,7 @@ export class MarkdownRenderer { .trim(); } - headingRule = (text: string, level: number, raw: string) => { + headingRule = (text: string, level: number, raw: string, slugger: marked.Slugger) => { if (level === 1) { this.currentTopHeading = this.saveHeading(text, level); } else if (level === 2) { @@ -129,7 +129,7 @@ export class MarkdownRenderer { this.currentTopHeading && this.currentTopHeading.id, ); } - return this.originalHeadingRule(text, level, raw); + return this.originalHeadingRule(text, level, raw, slugger); }; renderMd(rawText: string, extractHeadings: boolean = false): string { diff --git a/yarn.lock b/yarn.lock index bb73dd91..635ec148 100644 --- a/yarn.lock +++ b/yarn.lock @@ -768,10 +768,10 @@ dependencies: "@types/jquery" "*" -"@types/marked@^0.4.2": - version "0.4.2" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.2.tgz#64a89e53ea37f61cc0f3ee1732c555c2dbf6452f" - integrity sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg== +"@types/marked@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.6.0.tgz#e4ac316144a84afda5c2474488d7b9fef3ab9995" + integrity sha512-TxwhgR9VsIfRDJ3WwFokG8Xu+ea0nYGDRHdI783WJ983uffatz0ytIeUEIBOwPvRy241KRSNVyywQltuTqDh0w== "@types/minimatch@3.0.3": version "3.0.3" @@ -6257,9 +6257,10 @@ mark.js@^8.11.1: resolved "https://registry.yarnpkg.com/mark.js/-/mark.js-8.11.1.tgz#180f1f9ebef8b0e638e4166ad52db879beb2ffc5" integrity sha1-GA8fnr74sOY45BZq1S24eb6y/8U= -"marked@https://github.com/markedjs/marked#fb48827": - version "0.5.1" - resolved "https://github.com/markedjs/marked#fb48827236ed3a43e611d2adb3c070ca3f55ed8e" +marked@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/marked/-/marked-0.6.0.tgz#a18d01cfdcf8d15c3c455b71c8329e5e0f01faa1" + integrity sha512-HduzIW2xApSXKXJSpCipSxKyvMbwRRa/TwMbepmlZziKdH8548WSoDP4SxzulEKjlo8BE39l+2fwJZuRKOln6g== math-random@^1.0.1: version "1.0.1"