File tree 1 file changed +14
-18
lines changed
src/node/markdown/plugins
1 file changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -162,24 +162,20 @@ export async function highlight(
162
162
} ,
163
163
{
164
164
name : 'vitepress:empty-line' ,
165
- pre ( hast ) {
166
- hast . children . forEach ( ( code ) => {
167
- if ( code . type === 'element' && code . tagName === 'code' ) {
168
- code . children . forEach ( ( span ) => {
169
- if (
170
- span . type === 'element' &&
171
- span . tagName === 'span' &&
172
- Array . isArray ( span . properties . class ) &&
173
- span . properties . class . includes ( 'line' ) &&
174
- span . children . length === 0
175
- ) {
176
- span . children . push ( {
177
- type : 'element' ,
178
- tagName : 'wbr' ,
179
- properties : { } ,
180
- children : [ ]
181
- } )
182
- }
165
+ code ( hast ) {
166
+ hast . children . forEach ( ( span ) => {
167
+ if (
168
+ span . type === 'element' &&
169
+ span . tagName === 'span' &&
170
+ Array . isArray ( span . properties . class ) &&
171
+ span . properties . class . includes ( 'line' ) &&
172
+ span . children . length === 0
173
+ ) {
174
+ span . children . push ( {
175
+ type : 'element' ,
176
+ tagName : 'wbr' ,
177
+ properties : { } ,
178
+ children : [ ]
183
179
} )
184
180
}
185
181
} )
You can’t perform that action at this time.
0 commit comments