Skip to content
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

Add markdown support #421

Closed
krombel opened this issue Oct 10, 2018 · 7 comments · Fixed by #709
Closed

Add markdown support #421

krombel opened this issue Oct 10, 2018 · 7 comments · Fixed by #709
Assignees
Labels
enhancement A feature or change request for Quaternion

Comments

@krombel
Copy link
Contributor

krombel commented Oct 10, 2018

especially when writing

@rushsteve1
Copy link
Contributor

It looks like most Matrix clients render the Markdown to HTML on the clientside then send it as an HTML message.
So we would probably need a Markdown library. Nheko uses Cmark which is probably the best choice for us as well.

@KitsuneRal
Copy link
Member

What if we use basic RTF support that Qt already has? Qt can also easily convert it to HTML but unfortunately the set is richer (and uses CSS) than that supported by Riot.

@rushsteve1
Copy link
Contributor

I did some experimenting with the RTF in QT and while I still think that isn't a bad way to go, it's not the best. The big issue with it is that when it generates HTML it makes a full valid HTML document when we need just a a smaller portion.

That mixed with trying to only expose a subset of the RTF functionality to users makes it rather hard to use.

So I am thinking it would be best if we either found a Markdown library to use (as much as I hate adding dependencies) or wrote our own parser for a Markdown subset (also not a great idea).

@rushsteve1
Copy link
Contributor

I have experimental Markdown support working on my fork: https://github.com/rushsteve1/Quaternion/tree/cmark

It uses CommonMark which... To be honest isn't great. It doesn't support some common features such as underline and strikethrough. So if someone knows of a better library I could switch it.

@KitsuneRal
Copy link
Member

So far I feel that functionality of Markdown is so small that integrating another library may bring more overheads than benefits, compared to the homebaked code. Just an observation.

@KitsuneRal KitsuneRal added the enhancement A feature or change request for Quaternion label Mar 2, 2019
@KitsuneRal
Copy link
Member

Qt 5.14+ supports Markdown; #701 has a proof-of-concept in the form of /md command (assuming you build with recent enough Qt).

@KitsuneRal
Copy link
Member

KitsuneRal commented Oct 28, 2020

As of 0.0.9.5, there's /md command now; there's also going to be a hidden setting to make markdown the primary entry notation (instead of plain text+HTML). If this mode proves useful, 0.0.9.6 will have it exposed in settings.

@KitsuneRal KitsuneRal self-assigned this Oct 28, 2020
nicolasfella pushed a commit to nicolasfella/Quaternion that referenced this issue Dec 27, 2020
Part of the fix for quotient-im#421.

(cherry picked from commit 104356d945671762af23e346f7898a3208770d97)
nicolasfella pushed a commit to nicolasfella/Quaternion that referenced this issue Dec 27, 2020
Proxy servers may return arbitrary HTML, for one example; so don't
expect to find a valid JSON object in whatever non-empty payload
next to a non-2xx HTTP code. Fixes quotient-im#421.

(cherry picked from commit 9ef83e044ed4f8409156b19d529dfc7e45f565c1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature or change request for Quaternion
Projects
Status: Version 0.0.95 - Done
Development

Successfully merging a pull request may close this issue.

3 participants