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

Escaping tooltips #620

Closed
jabberwo opened this issue Jul 28, 2016 · 3 comments
Closed

Escaping tooltips #620

jabberwo opened this issue Jul 28, 2016 · 3 comments

Comments

@jabberwo
Copy link

Not sure where to write this. New to Fancytree and github for that matter.

I use a 2 iframe layout on my page. With fancytree on the left frame. Using jQuery widget for tooltips you are limited to the iframe -- they don't float over border like browser managed tooltips do. But when I try multi-line tooltips (using ) fancytree rendering code uses _escapeHtml.

I added a new option and would like to make it part of the project. In jquery.fancytree.js where the options json (line 4179 in the current version) is defined I added

    escapeTooltips: true,

Then were it escapes the HTML code I changed line 3452 to:

        tooltip = node.tooltip ? " title='" + (opts.escapeTooltips ? _escapeHtml(node.tooltip) : node.tooltip) + "'" : "";

Just sharing. And if it became part of the project I wont have to modify the javascript file next time!

cheers,
Jab

@mar10
Copy link
Owner

mar10 commented Aug 3, 2016

Thanks for contributing.
Not sure if I fully understand the request: you would like to include <br> or &#13; in the title attribute to generate multi-line tooltips?
The assumption was that html tags inside an title attribute are invalid html, so escaping should be ok.
But it seems that &#13; should be allowed (http://stackoverflow.com/a/13585406/19166), which is prevented by escaping as well.

Are you initializing the tree via JSON and did you try to pass \n (i.e. the newline byte 0x0D) instead?

@mar10 mar10 added the waiting label Aug 3, 2016
@mar10
Copy link
Owner

mar10 commented Aug 5, 2016

See also #610

@jabberwo
Copy link
Author

jabberwo commented Aug 8, 2016

Hi,
Yes I tried as well.  But the & was always escaped so you get "&#10;" or "&#13;".

@mar10 mar10 removed the waiting label Aug 8, 2016
mar10 added a commit that referenced this issue Oct 18, 2016
mar10 added a commit that referenced this issue Oct 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants