Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9019 closed bug (notabug)

Tooltip Title and HTML

Reported by: joshfreeman Owned by:
Priority: minor Milestone: none
Component: ui.tooltip Version: 1.10.0
Keywords: Cc:
Blocked by: Blocking:

Description

Hello,

It seems in the new JQueryUI update it is no longer possible to use html inside the title tag to format the tooltip.

Here is a demo using version 1.9.2 http://jsbin.com/itapis/1/edit

As you can see the tooltip is bolded.

Here is a demo using version 1.10.0 http://jsbin.com/itapis/2/edit

The html is outputted rather than formatted.

This might not be a bug and intended but I could not find a way to get html formatted.

Change History (6)

comment:1 Changed 7 years ago by joshfreeman

in the "2" edit the < and > got entity formatted, here is an example using correct formatting: http://jsbin.com/itapis/6/edit

comment:2 Changed 7 years ago by tj.vantoll

Resolution: notabug
Status: newclosed

Hi joshfreeman,

Thanks for taking the time to contribute to the jQuery UI project. Putting HTML within the title attribute is not valid HTML and we are now escaping it to prevent XSS vulnerabilities (see #8861).

If you need HTML in your tooltips use the content option - http://api.jqueryui.com/tooltip/#option-content.

comment:3 Changed 7 years ago by Scott González

#9084 is a duplicate of this ticket.

comment:4 Changed 7 years ago by tj.vantoll

#9113 is a duplicate of this ticket.

comment:5 Changed 7 years ago by mshaffer

If you need HTML in your tooltips use the content option - http://api.jqueryui.com/tooltip/#option-content.

=================

CAN YOU PLEASE PROVIDE AN EXAMPLE ... IF I GENERATED THE TOOLTIPS, HOW DO I ALLOW IT TO NOW RENDER HTML INSIDE?

content: $(this).attr('title'), this still doesn't render the HTML

comment:6 Changed 7 years ago by tj.vantoll

Replying to mshaffer:

If you need HTML in your tooltips use the content option - http://api.jqueryui.com/tooltip/#option-content.

=================

CAN YOU PLEASE PROVIDE AN EXAMPLE ... IF I GENERATED THE TOOLTIPS, HOW DO I ALLOW IT TO NOW RENDER HTML INSIDE?

content: $(this).attr('title'), this still doesn't render the HTML

Here's one: http://jsfiddle.net/tj_vantoll/9nfPU/. If you need further help please use the forums or Stack Overflow.

Note: See TracTickets for help on using tickets.