diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-01-28 10:50:39 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2023-01-28 10:50:39 +0100 |
commit | 872b00807fc03d6caf4e4b487880047261f21c08 (patch) | |
tree | 643a22755a9ed744c6eabd46f42d33b38566eee2 /src/timeline/InputBar.cpp | |
parent | Support strikethrough via ~~ (diff) | |
download | nheko-872b00807fc03d6caf4e4b487880047261f21c08.tar.xz |
Make newline behave consistently in markdown mode
by always sending as formatted when a newline is in the body
Diffstat (limited to '')
-rw-r--r-- | src/timeline/InputBar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index ad4a50eb..b6355418 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -457,7 +457,11 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow text.body = replaceMatrixToMarkdownLink(msg.trimmed()).toStdString(); // Don't send formatted_body, when we don't need to - if (text.formatted_body.find('<') == std::string::npos) + // Specifically, if it includes no html tag and no newlines (which behave differently in + // formatted bodies). Probably we forgot something, so this might need to expand at some + // point. + if (text.formatted_body.find('<') == std::string::npos && + text.body.find('\n') == std::string::npos) text.formatted_body = ""; else text.format = "org.matrix.custom.html"; |