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
Markdown support #4076
Markdown support #4076
Conversation
I believe it's generally expected that the zeroth line of code blocks (i.e. the remainder of the line after E.g.
should render as as single line:
not as two lines:
and
should render just like the first example with optional syntax highlighting (I'd consider that part out of scope of this PR though), not as
|
How does this fix #4075? Markdown does not typically render |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would definitely put the Markdown parsing logic into it’s own class.
TextMessage is a ui component, and Markdown conversion is quite a distinct functionality.
@Kissaki the issue states that although the functionality for quotes is broken, it is good the way it is. This PR has removed the respective code area altogether and provided proper support for quotations. That's why I think this closes the issue. |
This is great! I was going to try my hand at doing this today, but I guess I don't have to now. I only reported #4075 as an issue because I really didn't like the functionality, especially since it wasn't documented anywhere and there was no way to escape it. This implementation is more inline with what I'd expect, so I'm all for it. |
ed0b720
to
840ef83
Compare
@Kissaki I moved all markdown-related code to its own file (no need for a class though) @Johni0702 good catch! I adapted the code accordingly |
840ef83
to
8544cc4
Compare
BTW Qt already has builtin support for Markdown: https://doc-snapshots.qt.io/qt5-5.14/qtextedit.html |
Yes but only from 5.14 onwards. Until this is the version that is supported by the oldest still supported Ubuntu release, it'll probably take quite some time. And before that we can't make use of it. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
As a reference: Qt's implementation of Markdown stuff seems to live in https://github.com/qt/qtbase/tree/5.14.0/src/gui/text |
…ages Supported are sections, inline code and code-blocks, bold, italic and strikethrough text, links and quotes. It is also possible to use the backslash character to escape other characters (to prevent them from triggering Markdown interpretation). The changes made in this commit do not apply to direct messages though (which are assembled via a RichTextEditor and I haven't found a clever way to hack into that one yet). This implements mumble-voip#2945 and fixes mumble-voip#4075
8544cc4
to
2da3f0d
Compare
Hi, I tested this new feature, and it's great! However, I think I found a bug, the < and > characters in markdown code blocks get replaced by < and > |
@fedetft thank you for reporting back. Please create a new bug ticket for it as this merge request is already completed. Issues found are new bugs now. |
Supported are sections, inline code and code-blocks, bold, italic and
strikethrough text, links and quotes.
It is also possible to use the backslash character to escape other
characters (to prevent them from triggering Markdown interpretation).
The changes made in this commit do not apply to direct messages though
(which are assembled via a RichTextEditor and I haven't found a clever
way to hack into that one yet).
This implements #2945 and fixes #4075
An example:
yields

Changelog