Signal-android: Allow formatting of messages (bold, underline, italics)

Created on 14 Jun 2016  Â·  25Comments  Â·  Source: signalapp/Signal-Android

I have:


Feature description

Currently there is no way for a user to italicize, bold, or underline messages. Snapchat's UI is a good example to follow:

screenshot

If this is a feature you would like to have, please click on the "thumbs-up" button instead of writing a "me too!" comment. There is also a forum thread, and it is preferable to leave comments there. Thanks!

feature

Most helpful comment

Or supporting markdown syntax would be pretty cool

All 25 comments

Or supporting markdown syntax would be pretty cool

Bypass is a library which may help with rendering Markdown.

Markdown would be an amazing feature to have. I know not everything is a competition with WhatsApp but lacking text formatting is the second issue people have when I try migrating them to Signal. The first, of course, are the limited emoji.
Really hope some progress can be made on this front.

I routinely use the Whatsapp style of inline markdown syntax (which I love)...but then I have to explain it to people who don't get it (because Signal doesn't translate it) e.g.

It is _pouring_ outside (pouring is then represented in italics).

WhatsApp converts e.g.
image

into
image

Once you "close" the markdown tag as you are editing, it updates the text to reflect the format.

I love this for its simplicity - no extra menu options clogging up the screen. If it's important to you, you'll learn the markdown and use it. Would similarly love to have this in Signal.

This is exactly the implementation I would love to see though I hope Signal sticks to Markdown and doesn't go its own way like WhatsApp did.

Seems like a good idea. Bypass seems like the kind of thing we want, but I'd prefer something written in Java.

@moxie0 I tried my best and here is what I could find.
pegdown and txtmark, though I am not sure how close they are to being Bypass written in Java.
Will these two do or would we need something else?
Also, could it be possible to proceed with Bypass itself because it does look like the library that most directly addresses our needs and seems to emphasise ease of implementation and speed.
Maybe try it out in a Beta or Development release to see if it is something we can go ahead with? I would love to test it.

@Lokesh-Krishna Both of those produce HTML, we need something that produces a Spannable. Basically, we need something designed for Android.

We also don't need full markdown support, so it's probably straightforward just to write something that implements the few markdown tags we need. You'd have to submit a PR for that here, on iOS, and on the desktop simultaneously. Thanks!

I've looked around and I haven't been able to find a plain Java markdown parser that goes straight to Spannables instead of HTML. If anyone knows of one I'm willing to try implementing it.

Libraries I looked at:

  1. Bypass - Non-Java
  2. cwac-anddown - Non-Java, goes through HTML to reach Spannable
  3. MarkdownJ - Plain Java, but only goes to HTML, implemented as a series of regular expressions, not updated for years

If nobody knows of a suitable library then I propose we come up with a set of requirements and just roll our own.

Would basic inline support suffice to begin with?

We discussed libraries at the community forum but didn't fare much better.

As for requirements, I think italics, bold, underline and strikethrough should be all that would be needed for a texting app.

Would basic inline support suffice to begin with?

Does this mean implementing it the way it has been done in WhatsApp instead of the Snapchat implementation suggested in the very first post? If so then inline would definitely be the better option as it wouldn't clutter the action bar up and confuse those who aren't interested in this while letting users who do want to use it do so seamlessly.

If someone can sift through the code and find out what library is being used, there are two open source Android apps with Markdown implemented in them:

Are they of any help?

Does that library meet our requirements then?
I'm judging from the name that it is written in Java but does it produce a Spannable?

Hey, So based on the discussion here it looks like we haven't found a library that will solve this for us (or have we?).

Is it time to discuss creating a library that can solve this? I was considering writing a small(ish) parser that we could configure the output.

StringWithMarkdown -> Lib + config -> Spannables or HTML or whatever iOS needs.

However... and this is a big however. It's been a long time since I've done anything in Android, so I'm not sure how we'd implement something like that in a cross library way (Java, JS, and Swift or Objective C) Any thoughts?

@moxie0 prefers something written in Java, but that limits the cross-platform functionality quite a lot, as far as I understand it.

There's no point writing something cross-platform in C and then having it rejected because it's not written in Java, so I figure we'd want agreement to integrate before spending the time to write a cross-platform parser.

Is it acceptable to have it implemented on one platform and not the others?

Based on the discussion on the desktop issue for markdown support, whisperSystems wants it to release on all three at once.

Requirements for Markdown support in the Signal ecosystem as I understand them:

  1. Simultaneous release on all platforms
  2. Support for the same subset of Markdown
  3. Not native code on Android
  4. Not translating through HTML on Android

Given the languages used on the three clients (Javascript, Java, and Objective C), and the requirements suggested in this issue for Android, I don't see a way of writing this once and running it everywhere. That complicates the first two requirements.

Rolling three of our own solutions seems like a terrible idea resulting in bugs and inconsistencies between platforms.

Can someone responsible for each client in WhisperSystems have a conversation and come up with a realistic set of requirements for this feature? It seems like it'll just stagnate if not.

I was hoping we could write it in a single language (regardless of what that single implementation is) and transcompile it. Something like this: https://github.com/google/j2objc but with support for javascript as well.

Google Web Toolkit can help with that. http://www.gwtproject.org/

On May 26, 2017 10:23 PM, "Justin McMurdie" notifications@github.com
wrote:

I was hoping we could write it in a single language (regardless of what
that single implementation is) and transcompile it. Something like this:
https://github.com/google/j2objc but with support for javascript as well.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/WhisperSystems/Signal-Android/issues/5534#issuecomment-304420670,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AP0Lq8ox6StRYn3ZRAj-rjxfwwsJxpVjks5r94kngaJpZM4I1XeL
.

@fracture-point, you still don't need to know how Markdown works in order to use it on WhatsApp. If you select text, then press the three dots next to Copy and Paste, you can see there's a "Bold", "Italic", "Underlined", "Strikethrough", and "Monospaced" at the top.

That said, I think the way Snapchat does it is much easier to use because it's more readily accessed and there's no scrolling involved.

Also, I think ```code blocks``` should be supported. WhatsApp uses three backticks but maybe just one should be used instead.

@bmintz single backticks are for inline monospaced text. Three is for blocks.

Yeah but WhatsApp also doesn't have a separate code block and inline code format, which I think is fine.
Three backticks is also useful for Haskell code, for example, even' x = x `mod` 2 == 0.

Don't decide features because it would be convenient for the 10 people in the world who are sending Haskell code to each other via messenger.

Discussing the finer points of the implementation doesn't matter if nobody is going to implement it.

GitHub Issue Cleanup:
See #7598 for more information.

This feature request is being discussed and tracked here.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

5boro picture 5boro  Â·  3Comments

vvug picture vvug  Â·  3Comments

hiredgunhouse picture hiredgunhouse  Â·  3Comments

Dyras picture Dyras  Â·  3Comments

ilikenwf picture ilikenwf  Â·  3Comments