File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 80
80
"lru-cache" : " ^6.0.0" ,
81
81
"markdown-it" : " ^12.0.6" ,
82
82
"markdown-it-anchor" : " ^8.1.2" ,
83
+ "markdown-it-attrs" : " ^4.0.0" ,
83
84
"markdown-it-container" : " ^3.0.0" ,
84
85
"markdown-it-emoji" : " ^2.0.0" ,
85
86
"markdown-it-table-of-contents" : " ^0.5.2" ,
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import { extractHeaderPlugin } from './plugins/header'
14
14
import { Header } from '../shared'
15
15
import anchor , { AnchorOptions } from 'markdown-it-anchor'
16
16
17
+ const attrs = require ( 'markdown-it-attrs' )
17
18
const emoji = require ( 'markdown-it-emoji' )
18
19
const toc = require ( 'markdown-it-table-of-contents' )
19
20
@@ -23,6 +24,11 @@ export interface MarkdownOptions extends MarkdownIt.Options {
23
24
anchor ?: {
24
25
permalink ?: AnchorOptions [ 'permalink' ]
25
26
}
27
+ attrs ?: {
28
+ leftDelimiter ?: string
29
+ rightDelimiter ?: string
30
+ allowedAttributes ?: string [ ]
31
+ }
26
32
// https://github.com/Oktavilla/markdown-it-table-of-contents
27
33
toc ?: any
28
34
externalLinks ?: Record < string , string >
@@ -64,6 +70,12 @@ export const createMarkdownRenderer = (
64
70
...options . externalLinks
65
71
} )
66
72
73
+ . use ( attrs , {
74
+ leftDelimiter : '{' ,
75
+ rightDelimiter : '}' ,
76
+ allowedAttributes : [ ] ,
77
+ ...options . attrs
78
+ } )
67
79
// 3rd party plugins
68
80
. use ( anchor , {
69
81
slugify,
Original file line number Diff line number Diff line change @@ -3570,6 +3570,11 @@ markdown-it-anchor@^8.1.2:
3570
3570
resolved "https://registry.yarnpkg.com/markdown-it-anchor/-/markdown-it-anchor-8.1.2.tgz#1f26b102005cb7750d5159d06ba3cfa9400ebc3d"
3571
3571
integrity sha512-9D58TKK4dakqmjcmVuqHoB3ntKBpQJ0Ld38B83aiHJcBD72IZIyPjNtihPA6ayRI5WD33e1W68mArliNLHCprg==
3572
3572
3573
+ markdown-it-attrs@^4.0.0 :
3574
+ version "4.0.0"
3575
+ resolved "https://registry.npmjs.org/markdown-it-attrs/-/markdown-it-attrs-4.0.0.tgz#eadae3ea0c7d17c5e83b98a4ec95a47f4e4960f5"
3576
+ integrity sha512-uLjtdCmhhmL3BuZsReYkFxk74qKjj5ahe34teBpOCJ4hYZZl7/ftLyXWLowngC2moRkbLEvKwN/7TMwbhbHE/A==
3577
+
3573
3578
markdown-it-container@^3.0.0 :
3574
3579
version "3.0.0"
3575
3580
resolved "https://registry.yarnpkg.com/markdown-it-container/-/markdown-it-container-3.0.0.tgz#1d19b06040a020f9a827577bb7dbf67aa5de9a5b"
You can’t perform that action at this time.
0 commit comments