spreed icon indicating copy to clipboard operation
spreed copied to clipboard

Basic text formatting to chat

Open theel0ja opened this issue 6 years ago • 52 comments

I would like to have at least basic text formatting for chat, such as

  • Basic text formatting, such as bold, italic and ~~strikethrough~~
  • and code tags like this: console.log("Hello!");
  • and multi-line code this:
<html>
  <head></head>
  <body></body>
</html>

Spreed app

Spreed app version: Talk 3.2.2

Server configuration

Nextcloud Version: 1.0.4

theel0ja avatar Jul 09 '18 00:07 theel0ja

I think most other things have bold and italic, so that's okay. Not sure about code tags thou. THat will cause big trouble when we integrate with other services.

nickvergessen avatar Jul 09 '18 09:07 nickvergessen

Checked the messengers which I use:

IM bold italic striked code
Whatsapp * _ ~ ```
Threema * _ ~ :heavy_multiplication_x:
Telegram ** _ _ :heavy_multiplication_x: ```
Signal ✅ (WYSIWYG) ✅ (WYSIWYG) ✅ (WYSIWYG) ✅ (WYSIWYG)

nickvergessen avatar Jul 19 '18 10:07 nickvergessen

Survey: Should we support * as bold?

nickvergessen avatar Jul 30 '18 10:07 nickvergessen

Survey: Should we support _ as italic?

nickvergessen avatar Jul 30 '18 10:07 nickvergessen

Survey: Should we support ~ as striked?

nickvergessen avatar Jul 30 '18 10:07 nickvergessen

Survey: Should we support ``` as code?

nickvergessen avatar Jul 30 '18 10:07 nickvergessen

Survey: Should we support ``` as code?

Backticks are bad on a German keyboard layout, but they are also consistent with markdown.

fancycode avatar Jul 30 '18 11:07 fancycode

Why not add a full markdown support while we're at it? :)

mario avatar Jul 30 '18 11:07 mario

Why not add a full markdown support while we're at it? :)

Because at somepoint we would like to integrate with other services (see https://github.com/nextcloud/spreed/labels/feature%3A%20integration ) which is highly difficult then

nickvergessen avatar Jul 30 '18 11:07 nickvergessen

integrate with other services which is highly difficult then

Converting Markdown content into plain text shouldn't be that hard, no ?

tcitworld avatar Jul 30 '18 12:07 tcitworld

I'd add most stuff, but for example not headings because they aren't needed in chats.

theel0ja avatar Jul 30 '18 19:07 theel0ja

Well as for markdown, apart from the things in the poll the following are missing:

  • url - but you can post plain urls, which are still made clickable, you can just not mask them
  • images - we will allow posting images in another way (similar to how all other IMs do it.
  • lists - do you really need lists in chat messages?
  • headlines - see lists

nickvergessen avatar Aug 01 '18 12:08 nickvergessen

I think you can skip lists and headlines. If people want to write documents, they should not use the chat but some editor app :speak_no_evil:

fancycode avatar Aug 01 '18 12:08 fancycode

Lists do make sense, though, I use it also in chat... But certainly bold, underline, strike-through and code are much more important. Headlines do seem weird yes.

jospoortvliet avatar Aug 07 '18 16:08 jospoortvliet

With regard to https://github.com/nextcloud/spreed/issues/1027#issuecomment-408828927 (suggestion for full Markdown support)

I don't like the idea of having people post links (including potentially misleading ones,) images, or headlines to chat.

Syntax compatibility with markdown might be the most appropriate, but "full Markdown" seems like an own goal.

ryanprior avatar Apr 10 '19 18:04 ryanprior

Also, info for @nickvergessen & others who prioritize issues: this is one of the major blockers keeping me from using Nextcloud Chat. I frequently post code & read other people's code in chat, and need it to be formatted nicely.

I would be interested in working on this issue if it's something you would like outside help on.

ryanprior avatar Apr 10 '19 19:04 ryanprior

What about some quote/citation?

> used in markdown would be useful for that:

Example:

> something

something

lachmanfrantisek avatar Apr 11 '19 07:04 lachmanfrantisek

I would be interested in working on this issue if it's something you would like outside help on.

No objection at all. Everything that is not actively being worked on can be picked up. The main issue I see is:

  1. This needs to also work on iOS/Android
  2. It should be mostly done in the UI so third party integration works as good as possible
  3. There is a difference between markdown and all other chat clients how to do bold/italic
  4. The next thing on our todo is to bring the UI to VueJS (https://github.com/nextcloud/spreed/issues/1347) and that might heavily conflict with any work being done, because we are basically redoing the UI.

nickvergessen avatar Apr 11 '19 09:04 nickvergessen

How is the Android/iOS app built right now? I've never done mobile app development so I'm pretty ignorant of that side of things.

As far as building it into the UI and making it Vue proof, we might build it as an embedded Vue component right away without waiting for the rest of the UI to be re-done. My understanding is that Vue components can play well next to other things and it's not all-or-nothing.

ryanprior avatar Apr 17 '19 15:04 ryanprior

I would love to see parts of the markdown being implemented too. Especially for code or quotes. Is one thing that I find it as a "must" for a text-chat.

tiotrom avatar Oct 28 '19 03:10 tiotrom

Formating using keyboard shortcuts (CTRL+B, CTRL+U. etc) will apply as expected in the preview box, however, it does not carry formatted once submitted into Talk's conversation area. GIF screen capture below.

Peek 2019-11-12 00-06 Sorry for the flicker. I promise it's not subliminal messaging.

Tested on Nextcloud 17.0.1 Chromium Version 78.0.3904.97 (Official Build)

Gadgitmatic avatar Nov 12 '19 05:11 Gadgitmatic

I would love to see parts of the markdown being implemented too. Especially for code or quotes. Is one thing that I find it as a "must" for a text-chat.

Totally in for that. But I'm also all in for full markdown support. YES, it makes no sense to have links and or images available in two ways, BUT: markdown seems to me as a standard nowadays - for most devs at least. So why not supporting it? It would be easily integrated into apps and services, because there are tons of middlewares available. No need for a new parser - okay, yes, this is also true for stripped down markdown... ¯_(ツ)_/¯

Survey: Should we support ``` as code?

Triple is multiline. Might be intentional, might be a wrapping flaw by github (three single backticks do not convert to one single backtick shown as code). But I would go for a single backtick for inline code (and also triple for multiline).

That would be the most complete and useful input to me (from slack):

image

ltr:

  • bold
  • italic
  • striked
  • inline-code
  • link
  • num list
  • unsorted list
  • quote
  • multiline code space
  • hide toolbar (image below)
  • search for @<query>
  • 💩 selector

reduced image

small (as reply) w/ menu image

Formating using keyboard shortcuts (CTRL+B, CTRL+U. etc) will apply as expected in the preview box, however, it does not carry formatted once submitted into Talk's conversation area.

For me on latest chrome dev I have it as <html> transmitted.

boppy avatar Mar 01 '20 19:03 boppy

Survey: Should we support ``` as code?

I would recommend ``` as multi-line code, and ` as a single line code.

Honestly, Nextcloud Talk strikes me as more of a competitor to Mattermost/RocketChat/Slack/Teams than to, say, Signal etc. The former are more corporate-centric, managed, productivity chat applications... (hence the desire for powerful formatting options right at the chat line) the latter are more personal/individual chat applications. Although as a paranoid open-source fanboy, hook me up with those off-the-record end-to-end encrypted chats with perfect forward secrecy, fam. Anything that makes FBI directors meltdown in front of Congress. :)

Like Slack, it would be nice to get the ability to add text files in-line, and add syntax highlighting to them based on what they are (bash, PowerShell, Ruby, etc).

lists - do you really need lists in chat messages?

Absolutely. I used them all the time at my previous company when I was in Slack, because they're an easy, nicely-formatted way to just blast some quick 'n dirty instructions to a user. Most of my users were non-techie, so being able to easily make a nice, step-by-step set of instructions on how to reset their gate controller or whatever was super nice. Slack made it quite nice, too, it could tell when I was making a list and would begin auto numbering or auto-bulleting for me as I entered in a line and then hit Shift + Enter to the next line.

To add to the list of somewhat advanced features that I'd love to have available in in-line chat, I'd say tables, too. I asked the Slack team for this, and while they were very nice about it, they most likely concluded that I was an edge case and that this was a "maybe someday" feature request lol.

headlines - see lists

I'm with you on this one. Headlines do seem a little out of scope - if you find you need a headline... it's time for a change of tool, something like an email or a document of some kind.

EDIT: Check out Slack's formatting: https://slack.com/help/articles/202288908-Format-your-messages

tromlet avatar Aug 11 '20 21:08 tromlet

I am not in nextcloud development and architecture, but would it be possible to develop a plugin (as app available in the app store) for Talk which adds e.g. Markdown support?

Cacodaimon avatar Aug 31 '20 11:08 Cacodaimon

Not really, because the mobile apps would still not understand it and show ![image](url to image) then instead of an image. Also instead of implementing an additional addon, a PR to this app here would be enough.

nickvergessen avatar Aug 31 '20 11:08 nickvergessen

@nickvergessen I see, but if we ignore the fact that the apps would show plain markdown instead of formatted content would it be possible to build such a plugin which would work in the web / browser version only?

Maybe the formatting could be stripped (e.g. Bold becomes Bold) for apps consuming the API?

Cacodaimon avatar Aug 31 '20 11:08 Cacodaimon

Well all apps and the browser use the same API. But that is also not an issue. If we want this we just need to do it properly and tell the mobile apps to also understand it.

nickvergessen avatar Aug 31 '20 11:08 nickvergessen

@nickvergessen I see so a hint when fetching messages e.g. formattedContent = true which defaults to false could do the trick.

The apps does not know about this hint and gets content without formatting and the browser uses the hint to get formatted or plain markdown content.

Cacodaimon avatar Aug 31 '20 11:08 Cacodaimon

Well we just bump the api version in that case, and you use api/v3 for with markdown as ultimatly all clients need to support this.

nickvergessen avatar Aug 31 '20 12:08 nickvergessen

What should happen with the V2 API? Should it strip markdown content or would it cause some backward compatibility issues? (Maybe configurable)

The V3 in this case would pass the content as it is to client and the client would handle the formatting?

Any other requirements for an proper PR?

In this case I would set up an dev environment and dig into next cloud development this weekend.

Cacodaimon avatar Aug 31 '20 14:08 Cacodaimon