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

Unrendered markdown shown in notifications #74

Closed
webworxshop opened this issue Jun 8, 2019 · 12 comments
Closed

Unrendered markdown shown in notifications #74

webworxshop opened this issue Jun 8, 2019 · 12 comments
Labels
a:feature New feature or request

Comments

@webworxshop
Copy link

Hi,

First of all, thanks for the awesome software!

I've noticed when sending markdown messages that raw/unrendered markdown is displayed in the notification. This is particularly jarring when the first part of the message consists of a link or image.

I've attached a screenshot below to demonstrate:

Screenshot_20190608-181532

Is it possible to strip the markdown formatting and just display the textual content of the message in the notification.

My client/server versions are as follows:

Client: v2.0.7 (from F-Droid)
Server: v2.0.5 (Docker)

Thanks in advance.

@jmattheis jmattheis added the a:feature New feature or request label Jan 20, 2021
@Aerion
Copy link

Aerion commented Jan 21, 2021

Would it be possible to have the option of rendering the markdown instead of stripping it?

It seems feasible as Tasker autonotification modules manages to create notifications from HTML.
e.g. screenshot-2016-06-20-14-41-48-png (source)

If there is a way to render html in a notification, and the notification is in markdown, it should be feasible to render it, right?

@jmattheis
Copy link
Member

Sure, if it is possible then why not (:.

@jmattheis
Copy link
Member

9ba9405

@desbma
Copy link

desbma commented Aug 22, 2021

I can confirm Markdown is now rendered in notifications, but inline images still are not, see #164 (comment).

Maybe this issue should be reopened to track that, or should I open a new one?

@Sternagfonkel
Copy link
Contributor

There are several limitations for notifications on android. One of them is showing pictures. There is a "BigPictureStyle" which allows to show one picture in the notification. But what about the other three images someone perhaps has added to his markdown message? Also this picture wouldn't be inline. It would always use the whole width at the end of the notification. So I think this is useless regarding our purpose...
Please correct me if I'm wrong and there is a appropriate way to show images in a notification, but right now I don't see any.

@desbma
Copy link

desbma commented Aug 22, 2021

IMHO setting the notification picture if and only if the beginning of the markdown code is an image tag is a good compromise, that would work with the limitations you describe.

@Sternagfonkel
Copy link
Contributor

The image would have to be extracted from the other markdown processing. But yes, on android side this should work.
Another point is the communication to the user. It has to be clarified, that images are only supported under certain circumstances.

@jmattheis
Copy link
Member

I try to keep gotify as simple as possible to reduce the potential of bugs and the cost of code maintenance. Supporting this could certainly work, but I'm against it, because this is an edge case that probably affects only a small subset of users.

@rigrig
Copy link

rigrig commented Aug 25, 2021

Setting a notification picture would be nice, but I think it would be better to pass it as a separate Message Extra instead of trying to do clever things with the message content.

@webworxshop
Copy link
Author

My use case for this is sending camera images from my home automation system. This is something which is available on other notification platforms, but I choose to use gotify since I like to keep everything local. As such I don't believe that this is something which only affects a small subset of users.

As @rigrig suggested, I think the better implementation would be to have a message extra field for this. That seems simpler/cleaner than some magic markdown interpretation.

@jmattheis
Copy link
Member

Yeah, I'd be okay with an extras field. Maybe

{
  "extras": {
    "client::notification": {
      "imageUrl": "https://example.com/something.jpg"
    }
  }
}

Feel free to create an issue for this.

@webworxshop
Copy link
Author

@jmattheis Looks perfect, thanks. See #185.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature New feature or request
Development

No branches or pull requests

6 participants