File tree 2 files changed +5
-15
lines changed
packages/lexical-markdown/src
2 files changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ import {
24
24
$getRoot ,
25
25
$getSelection ,
26
26
$isParagraphNode ,
27
- $isTextNode ,
28
27
ElementNode ,
29
28
} from 'lexical' ;
30
29
@@ -248,15 +247,6 @@ function $importBlocks(
248
247
textMatchTransformers ,
249
248
) ;
250
249
251
- // Go through every text node in the element node and handle escape characters
252
- for ( const child of elementNode . getChildren ( ) ) {
253
- if ( $isTextNode ( child ) ) {
254
- const textContent = child . getTextContent ( ) ;
255
- const escapedText = textContent . replace ( / \\ ( [ * _ ` ~ ] ) / g, '$1' ) ;
256
- child . setTextContent ( escapedText ) ;
257
- }
258
- }
259
-
260
250
// If no transformer found and we left with original paragraph node
261
251
// can check if its content can be appended to the previous node
262
252
// if it's a paragraph, quote or list
Original file line number Diff line number Diff line change @@ -96,7 +96,6 @@ export function importTextTransformers(
96
96
textMatchTransformers ,
97
97
) ;
98
98
}
99
- return ;
100
99
} else if ( foundTextMatch ) {
101
100
const result = importFoundTextMatchTransformer (
102
101
textNode ,
@@ -130,9 +129,10 @@ export function importTextTransformers(
130
129
textMatchTransformers ,
131
130
) ;
132
131
}
133
- return ;
134
- } else {
135
- // Done!
136
- return ;
137
132
}
133
+
134
+ // Handle escape characters
135
+ const textContent = textNode . getTextContent ( ) ;
136
+ const escapedText = textContent . replace ( / \\ ( [ * _ ` ~ ] ) / g, '$1' ) ;
137
+ textNode . setTextContent ( escapedText ) ;
138
138
}
You can’t perform that action at this time.
0 commit comments