HubSpot / vex

A modern dialog library which is highly configurable and easy to style. #hubspot-open-source
http://github.hubspot.com/vex/docs/welcome
MIT License
6.92k stars 494 forks source link

HTML message #196

Closed alphaville closed 7 years ago

alphaville commented 7 years ago

Can I create a dialog with a message in HTML? For example, if I try to include HTML code in message:

vex.dialog.alert({
      message: 'hello <strong>world</strong>',
      className: 'vex-theme-flat-attack'
    })

I get the message hello &lt;strong&gt;world&lt;/strong&gt;.

alphaville commented 7 years ago

I found out that I should be using vex.dialog.open instead, so I'm closing this issue.

milosb793 commented 4 years ago

Hey @alphaville , I'm using vex.dialog.open too, and can see escaped HTML.

EDIT: I've found that in order to see HTML properly, the flag unsafeMessage should be used instead of only message. Example:

 vex.dialog.open({
      overlayClosesOnClick: false,
      unsafeMessage: messageHtml
 })