File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 91
91
"@types/gulp" : " 3.8.32" ,
92
92
"@types/inquirer" : " ^0.0.43" ,
93
93
"@types/jasmine" : " ^3.5.4" ,
94
- "@types/marked" : " ^0.4.2 " ,
94
+ "@types/marked" : " ^0.7.4 " ,
95
95
"@types/merge2" : " ^0.3.30" ,
96
96
"@types/minimist" : " ^1.2.0" ,
97
97
"@types/node" : " ^12.11.1" ,
132
132
"karma-sauce-launcher" : " ^2.0.2" ,
133
133
"karma-sourcemap-loader" : " ^0.3.7" ,
134
134
"madge" : " ^3.4.4" ,
135
- "marked" : " ^0.6.2 " ,
135
+ "marked" : " ^1.0.0 " ,
136
136
"merge2" : " ^1.2.3" ,
137
137
"minimatch" : " ^3.0.4" ,
138
138
"minimist" : " ^1.2.0" ,
Original file line number Diff line number Diff line change 1
- import { Renderer } from 'marked' ;
1
+ import { Renderer , Slugger } from 'marked' ;
2
2
import { basename , extname } from 'path' ;
3
3
4
- /** Regular expression that matches whitespace. */
5
- const whitespaceRegex = / \W + / g;
6
-
7
4
/** Regular expression that matches example comments. */
8
5
const exampleCommentRegex = / < ! - - \s * e x a m p l e \( ( [ ^ ) ] + ) \) \s * - - > / g;
9
6
@@ -18,10 +15,9 @@ export class DocsMarkdownRenderer extends Renderer {
18
15
* want to create a header-link for each H3 and H4 heading. This allows users to jump to
19
16
* specific parts of the docs.
20
17
*/
21
- heading ( label : string , level : number , _raw : string ) {
18
+ heading ( label : string , level : number , raw : string , slugger : Slugger ) {
22
19
if ( level === 3 || level === 4 ) {
23
- const headingId = label . toLowerCase ( ) . replace ( whitespaceRegex , '-' ) ;
24
-
20
+ const headingId = slugger . slug ( raw ) ;
25
21
return `
26
22
<h${ level } id="${ headingId } " class="docs-header-link">
27
23
<span header-link="${ headingId } "></span>
Original file line number Diff line number Diff line change 1324
1324
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef"
1325
1325
integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q==
1326
1326
1327
- "@types/marked@^0.4.2 ":
1328
- version "0.4.2 "
1329
- resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.4.2. tgz#64a89e53ea37f61cc0f3ee1732c555c2dbf6452f "
1330
- integrity sha512-cDB930/7MbzaGF6U3IwSQp6XBru8xWajF5PV2YZZeV8DyiliTuld11afVztGI9+yJZ29il5E+NpGA6ooV/Cjkg ==
1327
+ "@types/marked@^0.7.4 ":
1328
+ version "0.7.4 "
1329
+ resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.7.4. tgz#607685669bb1bbde2300bc58ba43486cbbee1f0a "
1330
+ integrity sha512-fdg0NO4qpuHWtZk6dASgsrBggY+8N4dWthl1bAQG9ceKUNKFjqpHaDKCAhRUI6y8vavG7hLSJ4YBwJtZyZEXqw ==
1331
1331
1332
1332
"@types/merge2@^0.3.30":
1333
1333
version "0.3.30"
@@ -7776,16 +7776,16 @@ marked@^0.3.2:
7776
7776
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
7777
7777
integrity sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==
7778
7778
7779
- marked@^0.6.2:
7780
- version "0.6.2"
7781
- resolved "https://registry.yarnpkg.com/marked/-/marked-0.6.2.tgz#c574be8b545a8b48641456ca1dbe0e37b6dccc1a"
7782
- integrity sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA==
7783
-
7784
7779
marked@^0.7.0:
7785
7780
version "0.7.0"
7786
7781
resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e"
7787
7782
integrity sha512-c+yYdCZJQrsRjTPhUx7VKkApw9bwDkNbHUKo1ovgcfDjb2kc8rLuRbIFyXL5WOEUwzSSKo3IXpph2K6DqB/KZg==
7788
7783
7784
+ marked@^1.0.0:
7785
+ version "1.0.0"
7786
+ resolved "https://registry.yarnpkg.com/marked/-/marked-1.0.0.tgz#d35784245a04871e5988a491e28867362e941693"
7787
+ integrity sha512-Wo+L1pWTVibfrSr+TTtMuiMfNzmZWiOPeO7rZsQUY5bgsxpHesBEcIWJloWVTFnrMXnf/TL30eTFSGJddmQAng==
7788
+
7789
7789
matchdep@^2.0.0:
7790
7790
version "2.0.0"
7791
7791
resolved "https://registry.yarnpkg.com/matchdep/-/matchdep-2.0.0.tgz#c6f34834a0d8dbc3b37c27ee8bbcb27c7775582e"
You can’t perform that action at this time.
0 commit comments