Skip to content

Commit

Permalink
chore: update marked to version 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lpinca committed Jan 2, 2019
1 parent ab943a8 commit ec5c0f9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -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.5.0",
"@types/prismjs": "^1.6.4",
"@types/prop-types": "^15.5.6",
"@types/react": "^16.7.7",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 3 additions & 1 deletion src/services/MarkdownRenderer.ts
Expand Up @@ -50,9 +50,11 @@ export class MarkdownRenderer {

private headingEnhanceRenderer: marked.Renderer;
private originalHeadingRule: typeof marked.Renderer.prototype.heading;
private slugger: marked.Slugger;

constructor(public options?: RedocNormalizedOptions) {
this.headingEnhanceRenderer = new marked.Renderer();
this.slugger = new marked.Slugger();
this.originalHeadingRule = this.headingEnhanceRenderer.heading.bind(
this.headingEnhanceRenderer,
);
Expand Down Expand Up @@ -129,7 +131,7 @@ export class MarkdownRenderer {
this.currentTopHeading && this.currentTopHeading.id,
);
}
return this.originalHeadingRule(text, level, raw);
return this.originalHeadingRule(text, level, raw, this.slugger);
};

renderMd(rawText: string, extractHeadings: boolean = false): string {
Expand Down
15 changes: 8 additions & 7 deletions yarn.lock
Expand Up @@ -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.5.0":
version "0.5.0"
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.5.0.tgz#4b91c66ee8cf0abb6938e02fdec207279959962e"
integrity sha512-5uRumM3yeMj+JcvWGku/FRJJCmSWZczLd8FJf76a90YCltRHVpjF2gKHiL6U+pi4qyATn7HvxR0Mk7mDySwaOQ==

"@types/minimatch@3.0.3":
version "3.0.3"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit ec5c0f9

Please sign in to comment.