File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -914,7 +914,7 @@ export function containsHtmlContent(element) {
914914 if ( stripped === '<br>' || stripped === '<br/>' ) {
915915 return true ; // single br considered html content
916916 }
917- return false ; // content that ends with br but has other text should be treated as plain text
917+ // For other cases with <br> and text, continue to Gmail-specific logic or return false
918918 }
919919
920920 // Gmail compose frequently uses structural wrapper tags (e.g. nested <div>/<span>/<p>)
@@ -939,6 +939,11 @@ export function containsHtmlContent(element) {
939939 }
940940 }
941941
942+ // For non-Gmail or when no structural tags found on Gmail, check for <br> with content
943+ if ( content && brRegex . test ( content ) ) {
944+ return false ; // content that ends with br but has other text should be treated as plain text
945+ }
946+
942947 // Slack uses a controlled editor that often emits nested wrapper tags. When the markup
943948 // is purely structural we treat it as plain text so the fast-path text-node update can
944949 // operate without resetting innerHTML (which tends to break Slack). However, if the
You can’t perform that action at this time.
0 commit comments