Skip to content

Commit 25a9b8c

Browse files
committed
Fix Gmail popup compose box capitalization by reordering containsHtmlContent logic
1 parent 8da15be commit 25a9b8c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/utils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)