Skip to content

Commit

Permalink
Fix preformatted text in mail body not breaking on mobile
Browse files Browse the repository at this point in the history
Preformatted text in mail body is supposed to be wrapped on mobile but
isn't due to an incorrect CSS selector.
  • Loading branch information
hrb-hub committed Feb 5, 2025
1 parent 9ea0d83 commit 283c747
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/gui/main-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ styles.registerStyle("main", () => {
".border-top": {
"border-top": `1px solid ${theme.content_border}`,
},
"#mail-body.break-pre pre": {
"#shadow-mail-body.break-pre pre": {
"white-space": "pre-wrap",
"word-break": "normal",
"overflow-wrap": "anywhere",
Expand Down
1 change: 1 addition & 0 deletions src/mail-app/mail/view/MailViewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ export class MailViewer implements Component<MailViewerAttrs> {
this.shadowDomRoot.firstChild.remove()
}
const wrapNode = document.createElement("div")
wrapNode.id = "shadow-mail-body"
wrapNode.className = "drag selectable touch-callout break-word-links" + (client.isMobileDevice() ? " break-pre" : "")
wrapNode.setAttribute("data-testid", "mailBody_label")
wrapNode.style.lineHeight = String(this.bodyLineHeight ? this.bodyLineHeight.toString() : size.line_height)
Expand Down

0 comments on commit 283c747

Please sign in to comment.