"Markdown" support in chat

The basics like bold, italics, underlined and strikethrough should be enough.

11 Likes
1 Like

Update: We implemented a bit markdown in desktop.
Also I made a pull request for adding the ā€˜specs’ for our markdown support to the interface repo https://github.com/deltachat/interface/pull/20

4 Likes

Please implement in the Android version

3 Likes

We plan to ultimately do message formatting in the core.
For now the markdown support was removed from desktop again because there were a few bugs with it.

5 Likes

Markdown has no specification and there are lots of flavours and different libraries that parse complicated cases differently because even the CommonMark ā€œstandardā€ does not specify every case.

If we want to support rich text, the most compatible way is to compose the message using WYSIWYG or markdown on the client and send HTML mail after that. Unlike markdown, HTML mail is readable in existing email clients. So a way to add this feature is to add HTML mail parsing to the core first, so it does not remove basic formatting, but transforms it into some machine readable format that can be displayed in the UI without doing the parsing there.

1 Like

Markdown is even readable in text form, so we don’t absolutely need HTML in my opinion, though it certainly could be a nice addition to also send html, to make people using traditional mail clients happy.
(probably while making cubans mad :smile: )

5 Likes

Markdown is even readable in text form

It is human-readable, but not machine-readable, because it is ambiguous. Sending markdown along with text/html is ok, but if you receive text/plain, it should not be parsed as markdown on receiver side.

foo ***bar **baz * foo is not parsed by this forum (it displays foo ***bar **baz * foo), same for CommonMark, but pandoc converts it to <p>foo <em><strong>bar </strong>baz </em> foo</p> (when not in CommonMark mode). And there are lots of cases where you want to just type literal * and escaping rules for * differ among implementations too. You can’t just escape everything, because it will be unreadable in plaintext, and the longer the text, the higher the chance that some unescaped * will be treated as a closing symbol. Add unicode character classification to the mix, with differences in how punctuation characters and so on are dectected depending on the version of unicode supported. pandoc has round-trip test for markdown disabled for this reason, and it is very difficult to make it work: pandoc/test/Tests/Readers/Markdown.hs at 57e29610ac3332807ac1ee897bc02b65236a7be3 Ā· jgm/pandoc Ā· GitHub

Also try typing some math in skype and see how annoying this markdown (or whatever markup they use) parsing is.

2 Likes

Even without a standard specification, I would personally be ok with just some basic Markdown support, which is much better than nothing.
I mostly only use bold, italic, bold+italic, bullet list, numbered list, and quote. For longer (chat) posts, also H3-H5.

1 Like

I like the way Pix-Art Messenger does it, it display the text in bold, italic, etc. but also shows the marks used, for example:
this is **bold** and _italic_

2 Likes

BTW even WhatsApp has some basic kinda-markdown support: ```text``` becomes monospace, ~text~ means strikethrough, text is italics and text is bold. They also show the marks (but only in grey) and format it while typing, like @adbenitez described, but when it is received the marks are hidden.

Not saying we should go this way (e.g. it sounds like lots of ui work on each platform, more that just showing some HTML from the core), I just wanted to mention it.

1 Like

There is some progress on this, desktop currently uses the new message parser, which already has the bases for markdown support. the new file of what we plan to support is in the repo of the new message-parser which is written in rust.

3 Likes

Seems very complicated to implement for the time being. Maybe something for the far future.

Wow, so much time has passed, and markdown has not been delivered to android. Well, how so.(

1 Like

arcane chat has markdown AFAIK

So I’m going to change the delta chat client to arcane chat for the sake of markdown? To be honest, I don’t understand why arcane chat is being developed in parallel, who is doing it, why, and what it achieves. I view arcane chat as a colorful clone. Delta Chat one love!!!

1 Like

There’s also this thread which has slightly more recent discussion about markdown, from one year ago. So I guess it’s still being implemented.

I think it’s being developed by @adbenitez who you’ll see is also active on here and also contributes to Delta Chat. Everyone is free to make their own client, and I guess Arcane Chat gives Asiel more flexibility to move quicker and implement features that would take longer to be implemented by the official Delta Chat client, and it can also be a nice incubator of new ideas. It would definitely be great to see features in Arcane Chat such as markdown support or the ability to selectively enable/disable specific accounts upstreamed to Delta Chat!

3 Likes

I’m really looking forward to markdown in Android.

As for Arcane chat, I’ve already tested it, and @adbenitez is doing a great job. Arcane chat is indeed evolving faster, but I prefer stability and consistency.

Arcane Chat is great indeed. I understand that there is more flexibility, audacity and development in a paralell client. I guess that popular and stable features will be implemented in the official app. I use both clients and recommend one or another, depending on the person.

About markdown, maybe I am wrong but people ā€œneedā€ to do things easily. Select a piece of text ant make it bold, just clicking the word ā€œboldā€ somewhere.

I honestly find typing inline markdown easier that switching to the mouse to find and click a button, but people vary. The former method should at least be reasonably discoverable.

I’m not really wanting formatting in e-mails much, but markdowns would be a much better way to do it than HTML. There is compatibility to consider, though.