| Summary: | Custom emoji in backticks sends HTML img tag | ||
|---|---|---|---|
| Product: | [Applications] NeoChat | Reporter: | tedster3 |
| Component: | General | Assignee: | Tobias Fella <fella> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | carl, james.h.graham |
| Priority: | NOR | ||
| Version First Reported In: | 23.08.3 | ||
| Target Milestone: | --- | ||
| Platform: | Fedora RPMs | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/network/neochat/-/commit/d25340bc31c63e9ec26312709f11c26c5234d78b | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
| Attachments: | Screenshot showing the problem of sending custom emoji in backticks | ||
Indeed the text should be left alone when within a code block A possibly relevant merge request was started @ https://invent.kde.org/network/neochat/-/merge_requests/1475 Git commit d25340bc31c63e9ec26312709f11c26c5234d78b by James Graham. Committed on 09/12/2023 at 15:28. Pushed by nvrwhere into branch 'master'. Fix inline custom emojis in codeblocks Make sure that custom emojis in inline code blocks are not turned into images. By calling preprocess text in `texthandler` the whole function can be simplified as it will now never be called on any text inside any code block (which was the reason for all the split stuff previously). M +46 -0 autotests/texthandlertest.cpp M +0 -2 src/actionshandler.cpp M +6 -14 src/models/customemojimodel.cpp M +1 -1 src/models/customemojimodel.h M +11 -2 src/texthandler.cpp https://invent.kde.org/network/neochat/-/commit/d25340bc31c63e9ec26312709f11c26c5234d78b Confirmed to be working with the latest master as of this writing (1d8ffb22ee777474cceccba6f95f6a50a1672647). |
Created attachment 163475 [details] Screenshot showing the problem of sending custom emoji in backticks SUMMARY When sending a shortcode for a custom emoji within backticks for code formatting, NeoChat literally sends the HTML <img> tag. STEPS TO REPRODUCE 1. Create a custom emoji with a shortcode, e.g.: :custom_emoji: 2. Enter the following in the "Send a message..." field: `:custom_emoji:` 3. Send the message OBSERVED RESULT The following message is sent (with code/monospace formatting): <img data-mx-emoticon="" src="mxc://example.com/qboavWktsdUCfzAFyOvDpBoR" alt=":custom_emoji:" title=":custom_emoji:" height="32" vertical-align="middle" /> EXPECTED RESULT The custom emoji shortcode is sent with code formatting. i.e.: :custom_emoji: SOFTWARE/OS VERSIONS Windows: - macOS: - Linux/KDE Plasma: Fedora Linux 39 (KDE Plasma Desktop Spin) (available in About System) KDE Plasma Version: 5.27.9 KDE Frameworks Version: 5.111.0 Qt Version: 5.15.11 ADDITIONAL INFORMATION The attached image shows the issue.