ntfy icon indicating copy to clipboard operation
ntfy copied to clipboard

Feature Request: Message formatting (Markdown, or otherwise)

Open NiNiyas opened this issue 2 years ago • 21 comments

The ability to format messages. Like bold, italics and so on. Here for example is the discord formatting guide.

NiNiyas avatar Jun 04 '22 10:06 NiNiyas

Bravo for being the first 🥇 to actually open a ticket for this. About 50 people have asked, but nobody created a ticket. ;-)

binwiederhier avatar Jun 04 '22 10:06 binwiederhier

Does this mean ntfy does not atm support any formatting in the body?

MichelMichels avatar Mar 27 '23 13:03 MichelMichels

Correct

binwiederhier avatar Mar 27 '23 14:03 binwiederhier

What would be the realistic steps to implement such an idea? I don't have any experience with Go, but am proficient in C#. I could try to set something up to help with the development of this feature.

MichelMichels avatar Mar 27 '23 14:03 MichelMichels

This would be 90% Android, 10% server; probably just pulling in a markdown library in Android, and then somehow carrying the "content-type" through the message to the client; could potentially even use the "encoding" field for that.

binwiederhier avatar Mar 27 '23 14:03 binwiederhier

I'm working on this now. I will be using the markwon library even though it has not been updated in 2 years :grimacing:

image

Design proposal

Right now, I'm thinking:

  • Add a content_type field to the message, which is text/plain by default, and can now also be text/markdown.
  • The content type can be passed via the Content-Type: text/markdown header, or via X-Markdown: yes or Markdown: yes or md: yes
  • The Android app by default will allow parsing markdown, but will have an option to disable embedding of external images:
    • [ ] Allow embedding markdown images
    • [x] Do not allow embedding markdown images

Thoughts? @wunter8 maybe. :grimacing:

binwiederhier avatar May 23 '23 19:05 binwiederhier

Looks good to me!

I am surprised this is being added to Android before the web app, but it'll be very nice to have!

wunter8 avatar May 23 '23 19:05 wunter8

The Android app by default will allow parsing markdown, but will have an option to disable embedding of external images:

Will you be able to disable parsing markdown entirely? Or just disable automatic download of images in markdown? Will this be per subscription?

wunter8 avatar May 23 '23 19:05 wunter8

Will you be able to disable parsing markdown entirely? Or just disable automatic download of images in markdown? Will this be per subscription?

Might as well also allow disabling it entirely. And yes, probably global and per-subscription, just like the other options.

binwiederhier avatar May 23 '23 23:05 binwiederhier

@nimbleghost I know you're looking for your next challenge: Wanna do this one, the web app side? :grimacing: I have started the Android side a while back, before you came along and side-tracked me hard hehe.

There is a markdown branch (with minimal changes so far), but no changes in the web app, or any persistence in the message cache.

binwiederhier avatar Jul 05 '23 01:07 binwiederhier

Thanks to @nihalgonsalves's work the server and web app side of Markdown support is now merged to main. The ticket will remain open for the Android portion of it.

binwiederhier avatar Jul 09 '23 11:07 binwiederhier

Hey,

love the project and its progress! But for me the markdown does not work on any instance (public / selfhosted).

Should it already be available?

curl -d "Look ma, **bold text**, *italics*, ..." -H "Markdown: yes" ntfy.sh/rAU8FLX2R9NiXZRf

In case it matters: I use Brave, a chromium based browser. Version 1.56.11 Chromium: 115.0.5790.102 (Official Build) (64-bit)

Kariton avatar Jul 21 '23 23:07 Kariton

It's not released yet.

binwiederhier avatar Jul 22 '23 01:07 binwiederhier

Thank you for confirming.

I was not sure because its documented but the issue is still open.

Love what you have created! Its impressive.

Kariton avatar Jul 22 '23 11:07 Kariton

Markdown is now obviously live! Looks and works great! 😍

(and also does the embedded picture!)

LOVE IT!

EDIT: at least on the web interface. 😃

Kariton avatar Aug 18 '23 00:08 Kariton

Are there any plans to implement this in the Android app as well? I spent 2 hours figuring out why markdown formatting did not work for me, until I found this issue :(

fuse314 avatar Jan 17 '24 05:01 fuse314

Plans? Yes. I believe there is a work-on-progress branch that was started even. Timeline for estimated completion? Not yet

wunter8 avatar Jan 17 '24 21:01 wunter8