[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Bug 488325 - Neochat doesn't render html character
Summary: Neochat doesn't render html character
Status: RESOLVED FIXED
Alias: None
Product: NeoChat
Classification: Applications
Component: General (show other bugs)
Version: git master
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Tobias Fella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-10 20:14 UTC by Tobias Fella
Modified: 2024-07-23 17:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Fella 2024-06-10 20:14:20 UTC
with this event, neochat shows the escape sequences in the code block instead of the characters that are supposed to be shown

{
    "content": {
        "body": "> <@deepbluev7:neko.dev> !sh cat /dev/aliases\n\nExited with code 1 in 48.0 ms. **stderr:**\n\n```\n\ncat: can't open '/dev/aliases': No such file or directory\n\n```",
        "format": "org.matrix.custom.html",
        "formatted_body": "<mx-reply><blockquote><a href='https://matrix.to/#/!urandom, version 9️⃣:maunium.net/$IjtPTuHjTcHrnJf5IkIuQXn8m_lzzVQ7VLAcLVLbquY'>In reply to</a> <a href='https://matrix.to/#/@deepbluev7:neko.dev'>@deepbluev7:neko.dev</a><br/>!sh cat /dev/aliases</blockquote></mx-reply><p>Exited with code 1 in 48.0 ms. <strong>stderr:</strong></p>\n<pre><code>\ncat: can&#x27;t open &#x27;/dev/aliases&#x27;: No such file or directory\n</code></pre>\n",
        "m.relates_to": {
            "m.in_reply_to": {
                "event_id": "$IjtPTuHjTcHrnJf5IkIuQXn8m_lzzVQ7VLAcLVLbquY"
            }
        },
        "msgtype": "m.notice"
    },
    "event_id": "$Xox7yliP7yj8bTcpP3pAbMCdqfKsEEP6Mhzr8rA5b1k",
    "origin_server_ts": 1718049530356,
    "sender": "@urandom:maunium.net",
    "type": "m.room.message",
    "unsigned": {
    }
}
Comment 1 James Graham 2024-07-23 13:42:54 UTC
Hmm, not sure on this one. We treat everything in a code block as plain text because it should be. So unless we did that it's a bug with the client that sent it.

It would be impossible to consistently figure out when we should or shouldn't convert these someone for example may intentionally want to send the escape sequences to be viewed. Treating as plain text is the only sane way to work.
Comment 2 James Graham 2024-07-23 13:59:07 UTC
Actually thinking about it we should
Comment 3 Bug Janitor Service 2024-07-23 14:05:54 UTC
A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/1818
Comment 4 James Graham 2024-07-23 17:27:03 UTC
Git commit 11475259a180aec98022f905be59420870078c8f by James Graham.
Committed on 23/07/2024 at 17:27.
Pushed by nvrwhere into branch 'master'.

Make sure that apostrophes are unescaped when visualising messages

Title

M  +1    -0    autotests/texthandlertest.cpp
M  +1    -0    src/texthandler.cpp

https://invent.kde.org/network/neochat/-/commit/11475259a180aec98022f905be59420870078c8f