@@ -61,17 +61,18 @@ export class CodeblockRantProcessor extends BaseRantProcessor {
61
61
62
62
export class InlineRantProcessor extends BaseRantProcessor {
63
63
renderResult ( ) {
64
- let temp = createEl ( "div " ) ;
64
+ let temp = createEl ( "span " ) ;
65
65
MarkdownRenderer . renderMarkdown ( this . result , temp , this . sourcePath , this ) ;
66
66
67
- this . container . empty ( ) ;
68
- this . container . className = this . getStyles ( ) . join ( " " ) ;
69
-
67
+ let nodes : Node [ ] = [ ] ;
70
68
temp . childNodes . forEach ( ( paragraph ) => {
71
- paragraph . childNodes . forEach ( ( node ) => {
72
- this . container . appendChild ( node . cloneNode ( true ) ) ;
73
- } ) ;
69
+ nodes . push ( ...( paragraph . childNodes as any as Node [ ] ) ) ;
70
+ nodes . push ( createEl ( "br" ) ) ;
74
71
} ) ;
72
+ nodes . pop ( ) ;
73
+
74
+ this . container . className = this . getStyles ( ) . join ( " " ) ;
75
+ this . container . replaceChildren ( ...nodes ) ;
75
76
}
76
77
77
78
getStyles ( ) {
@@ -134,17 +135,18 @@ export class BlockLinkRantProcessor extends BaseRantProcessor {
134
135
}
135
136
136
137
renderResult ( ) {
137
- let temp = createEl ( "div " ) ;
138
+ let temp = createEl ( "span " ) ;
138
139
MarkdownRenderer . renderMarkdown ( this . result , temp , this . sourcePath , this ) ;
139
140
140
- this . container . empty ( ) ;
141
- this . container . className = this . getStyles ( ) . join ( " " ) ;
142
-
141
+ let nodes : Node [ ] = [ ] ;
143
142
temp . childNodes . forEach ( ( paragraph ) => {
144
- paragraph . childNodes . forEach ( ( node ) => {
145
- this . container . appendChild ( node . cloneNode ( true ) ) ;
146
- } ) ;
143
+ nodes . push ( ...( paragraph . childNodes as any as Node [ ] ) ) ;
144
+ nodes . push ( createEl ( "br" ) ) ;
147
145
} ) ;
146
+ nodes . pop ( ) ;
147
+
148
+ this . container . className = this . getStyles ( ) . join ( " " ) ;
149
+ this . container . replaceChildren ( ...nodes ) ;
148
150
}
149
151
150
152
getStyles ( ) {
0 commit comments