-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multi-line code blocks apply monospace font to entire message #853
Comments
It also makes the whole message horizontally scrollabel and not auto breaking if there is a code block.. |
Yes, those are limitations we are aware of, thanks for having created the issue. To be honest, we are thinking on removing the scrollability on code blocks and rather replace it with a real code previewer, which will be opened when you click on a code block, and which will display line numbers on the left, will be scrollable in each direction and eventually have syntax coloration. Some libraries may doing this quite well. This could also be used for (decrypted) event source preview, rather than the simple dialog we have so far. |
If there are no good syntax highlighting libraries in kotlin or java it might be a cool project for someone to wrap https://github.com/trishume/syntect in a usable library for Android. It uses the SublimeText syntaxes for highlighting and it's probably a lot faster than doing the highlighting in .js. The easiest way would still be generating html like this https://github.com/trishume/syntect/blob/master/examples/synhtml.rs and displaying it in a webview, but a syntect -> spannable conversion would be really cool To use rust libraries from gradle this might be helpful: https://github.com/mozilla/rust-android-gradle |
@bmarty This is totally a subjective thing, but I personally would prefer code block scrollability over a dedicated code view, since a lot of people I know (myself included) mix code blocks with prose when collaborating with others. A dedicated code view would take you away from the prose as you look at the code, at least from my current understanding of how that'd be implemented. |
related/more infos: #1375 |
When using multi-line code blocks in a message, the entire message appears to be rendered as preformatted text. RiotX v0.12.0. See below for example.
Message source containing multi-line code block.
The
<pre>
tag is correctly placed informatted_body
, but the message renders incorrectly.The text was updated successfully, but these errors were encountered: