Page 1 of 1

Line Break in Notification Title

Posted: Sun Mar 07, 2021 11:49 am
by Roblsforbobls
Hi everyone,

Is there a way to add a line break in a notification title using an eval? I have tried using white space characters with inconsistent results, so a clean line break is preferable I think. (https://en.wikipedia.org/wiki/Whitespace_character)

For context, my goal is to make a grid of squares in a notification. I am trying to adapt the visual maze map made by notSafeForDev (see here: viewtopic.php?f=2&t=23415&p=297920#p297920) into a notification instead of a say action. The best way to do this I think would be to use some kind of line break. I have already tried using "/n" and <br> and am either using them wrong or they don't work in EOS.

Any ideas?

Thanks,
Robls

Re: Line Break in Notification Title

Posted: Sun Mar 07, 2021 4:34 pm
by RemiHiyama
Seems odd that br isn't working. The regular html sanitizer allows it, the button text is in a button tag (which allows br) and the title is in a div (which allows everything). So maybe it's going through a different sanitizer? But I can't find where it's going through one at all (and it's gotta be going through one somewhere).

Re: Line Break in Notification Title

Posted: Sun Mar 07, 2021 4:47 pm
by fapnip
No. HTML isn't currently allowed in Eos' notification titles or buttons. I have a request for it in:
https://github.com/milovana/eos-issues/issues/10

(I was trying to do a similar thing in a notification title. There currently isn't a way to do it with reliable results.)

Re: Line Break in Notification Title

Posted: Sun Mar 07, 2021 7:00 pm
by fapnip
RemiHiyama wrote: Sun Mar 07, 2021 4:34 pm But I can't find where it's going through one at all (and it's gotta be going through one somewhere).
I believe the issue is that the Notification module isn't using react-render-html, so it has no need for HtmlSanitizer since react is just going to encode any html entities for display as text without the use of something like react-render-html, dangerouslySetInnerHTML, etc. (Could be wrong -- been awhile since I've used react.)