@@ -1088,9 +1088,9 @@ export class TextNode extends LexicalNode {
1088
1088
}
1089
1089
}
1090
1090
1091
- function convertSpanElement ( domNode : Node ) : DOMConversionOutput {
1091
+ function convertSpanElement ( domNode : HTMLSpanElement ) : DOMConversionOutput {
1092
1092
// domNode is a <span> since we matched it by nodeName
1093
- const span = domNode as HTMLSpanElement ;
1093
+ const span = domNode ;
1094
1094
const style = span . style ;
1095
1095
1096
1096
return {
@@ -1099,9 +1099,11 @@ function convertSpanElement(domNode: Node): DOMConversionOutput {
1099
1099
} ;
1100
1100
}
1101
1101
1102
- function convertBringAttentionToElement ( domNode : Node ) : DOMConversionOutput {
1102
+ function convertBringAttentionToElement (
1103
+ domNode : HTMLElement ,
1104
+ ) : DOMConversionOutput {
1103
1105
// domNode is a <b> since we matched it by nodeName
1104
- const b = domNode as HTMLElement ;
1106
+ const b = domNode ;
1105
1107
// Google Docs wraps all copied HTML in a <b> with font-weight normal
1106
1108
const hasNormalFontWeight = b . style . fontWeight === 'normal' ;
1107
1109
@@ -1271,13 +1273,13 @@ const nodeNameToTextFormat: Record<string, TextFormatType> = {
1271
1273
u : 'underline' ,
1272
1274
} ;
1273
1275
1274
- function convertTextFormatElement ( domNode : Node ) : DOMConversionOutput {
1276
+ function convertTextFormatElement ( domNode : HTMLElement ) : DOMConversionOutput {
1275
1277
const format = nodeNameToTextFormat [ domNode . nodeName . toLowerCase ( ) ] ;
1276
1278
if ( format === undefined ) {
1277
1279
return { node : null } ;
1278
1280
}
1279
1281
return {
1280
- forChild : applyTextFormatFromStyle ( ( domNode as HTMLElement ) . style , format ) ,
1282
+ forChild : applyTextFormatFromStyle ( domNode . style , format ) ,
1281
1283
node : null ,
1282
1284
} ;
1283
1285
}
0 commit comments