jpillora / notifyjs

Notify.js - A simple, versatile notification library
https://notifyjs.jpillora.com/
MIT License
1.91k stars 740 forks source link

Displaying HTML #102

Open ekkis opened 7 years ago

ekkis commented 7 years ago

if I write:

$.notify("Fix me <b>now</b>", "success");

I get the tags in the message instead of getting a bold word. the module should allow display of HTML, which is particularly useful if you want to include little icons in the message (in real life I want to display a "copy" icon for copying the message to the clipboard).

what I'd like to know is: if I submit a PR, will it be accepted? I don't want to waste my time writing one if it won't

jpillora commented 7 years ago

See docs, search notify-html

On Tue, Feb 21, 2017 at 10:05 AM Erick Calder notifications@github.com wrote:

if I write:

$.notify("Fix me now", "success");

I get the tags in the message instead of getting a bold word. the module should allow display of HTML, which is particularly useful if you want to include little icons in the message (in real life I want to display a "copy" icon for copying the message to the clipboard).

what I'd like to know is: if I submit a PR, will it be accepted? I don't want to waste my time writing one if it won't

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jpillora/notifyjs/issues/102, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmr87Bdup0a4GmVjNYHJ-3P0T6WYbd2ks5rehwngaJpZM4MGs0_ .

ricleal commented 7 years ago

@ekkis : Did you find a solution for your problem? I have the same issue and can't circumvent it without styles... I wonder if there is something easier...

ekkis commented 7 years ago

I abandoned it for the moment. spent some time looking at their code but I wasn't sure that if I produce a PR that they'd accept it so I didn't bother. I do need to solve the problem eventually. it's on my roadmap

ishpreetkaurwebner commented 3 years ago

Hello @jpillora : I am also facing problem like this, I have message in following format

var message = '<p> Please correct following errors and then try again </p><ul><li>value1 is wrong</li><li>value 3 is wrong</li><li>value 5 is wrong</li></ul>';
$.notify(message, "error");

Then message is shown as it is, means whole html is displaying, instead I want to display like

Please correct following errors and then try again
-  value1 is wrong
- value3 is wrong
- value5 is wrong

Please, any simple workaround for this?

ishpreetkaurwebner commented 3 years ago

I abandoned it for the moment. spent some time looking at their code but I wasn't sure that if I produce a PR that they'd accept it so I didn't bother. I do need to solve the problem eventually. it's on my roadmap

Hello @ekkis : Can you tell me how did you solved it. I also need some sort of this like for message var message = '<p> Please correct following errors and then try again </p><ul><li>value1 is wrong</li><li>value 3 is wrong</li><li>value 5 is wrong</li></ul>';

ekkis commented 3 years ago

Hello @ekkis : Can you tell me how did you solved it

I never came back to it. sorry

ishpreetkaurwebner commented 3 years ago

@jpillora : Can you give with an example how to use html message with data-notify-html?