File tree 2 files changed +10
-5
lines changed
docs/latest/getting-started
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ The new page will be visible at `http://localhost:8000/about`.
52
52
pages in the _Getting Started_ guide will also explain more features of routes. -->
53
53
54
54
[ concepts-routing ] : /docs/concepts/routing
55
- [ jsx ] : https://reactjs.org/docs/introducing- jsx.html
55
+ [ jsx ] :https://react.dev/learn/writing-markup-with- jsx
56
56
[ preact ] : https://preactjs.com/
57
57
58
58
<!-- [concepts-routes]: /docs/concepts/routes -->
Original file line number Diff line number Diff line change @@ -113,22 +113,27 @@ class DefaultRenderer extends Marked.Renderer {
113
113
return out ;
114
114
}
115
115
116
- override blockquote ( { text } : Marked . Tokens . Blockquote ) : string {
116
+ override blockquote ( { text, tokens } : Marked . Tokens . Blockquote ) : string {
117
117
const match = text . match ( ADMISSION_REG ) ;
118
+
118
119
if ( match ) {
119
120
const label : Record < string , string > = {
120
121
tip : "Tip" ,
121
122
warn : "Warning" ,
122
123
info : "Info" ,
123
124
} ;
125
+ Marked . walkTokens ( tokens , ( token ) => {
126
+ if ( token . type === "text" && token . text . startsWith ( match [ 0 ] ) ) {
127
+ token . text = token . text . slice ( match [ 0 ] . length ) ;
128
+ }
129
+ } ) ;
124
130
const type = match [ 1 ] ;
125
- text = text . slice ( match [ 0 ] . length ) ;
126
131
const icon = `<svg class="icon"><use href="/icons.svg#${ type } " /></svg>` ;
127
132
return `<blockquote class="admonition ${ type } ">\n<span class="admonition-header">${ icon } ${
128
133
label [ type ]
129
- } </span>${ Marked . parse ( text ) } </blockquote>\n`;
134
+ } </span>${ Marked . parser ( tokens ) } </blockquote>\n`;
130
135
}
131
- return `<blockquote>\n${ Marked . parse ( text ) } </blockquote>\n` ;
136
+ return `<blockquote>\n${ Marked . parser ( tokens ) } </blockquote>\n` ;
132
137
}
133
138
}
134
139
You can’t perform that action at this time.
0 commit comments