fix: fix message overflowing because break spaces were stopped by pre

This commit is contained in:
Jonathan Rainville 2020-07-20 17:22:36 -04:00 committed by Iuri Matias
parent 911aac92de
commit 4c7c8a06a3
1 changed files with 34 additions and 34 deletions

View File

@ -6,44 +6,44 @@ StyledTextEdit {
id: chatText
visible: contentType == Constants.messageType || isEmoji
textFormat: Text.RichText
text: {
if(contentType === Constants.stickerType) return "";
let msg = Utils.linkifyAndXSS(message);
if(isEmoji){
return Emoji.parse(msg, "72x72");
} else {
return `<html>
<head>
<style type="text/css">
code {
background-color: #1a356b;
color: #FFFFFF;
white-space: pre;
}
p {
white-space: pre;
}
a.mention {
color: ${isCurrentUser ? Style.current.black : Style.current.white}
font-weight: bold;
}
blockquote {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
${Emoji.parse(msg, "26x26")}
</body>
</html>`;
}
}
horizontalAlignment: Text.AlignLeft
wrapMode: Text.Wrap
font.pixelSize: 15
readOnly: true
selectByMouse: true
color: Style.current.textColor
text: {
if(contentType === Constants.stickerType) return "";
let msg = Utils.linkifyAndXSS(message);
if(isEmoji){
return Emoji.parse(msg, "72x72");
} else {
return `<html>`+
`<head>`+
`<style type="text/css">`+
`code {`+
`background-color: #1a356b;`+
`color: #FFFFFF;`+
`white-space: pre;`+
`}`+
`p {`+
`white-space: pre-wrap;`+
`}`+
`a.mention {`+
`color: ${isCurrentUser ? Style.current.black : Style.current.white};`+
`font-weight: bold;`+
`}`+
`blockquote {`+
`margin: 0;`+
`padding: 0;`+
`}`+
`</style>`+
`</head>`+
`<body>`+
`${Emoji.parse(msg, "26x26")}`+
`</body>`+
`</html>`;
}
}
}