question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Possible to have line breaks without HTML mode?

See original GitHub issue

When I have a tooltip with new line like this:

title="First line
Second line"

I get a line break in the vanilla tooltip:

temp

When using tooltipster it removes the line break. I don’t want to use <br/> and HTML mode.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
louisamelinecommented, Sep 2, 2016

Yes but a one-liner using functionInit or functionFormat will do it.

0reactions
0x4E69676874466F78commented, Sep 24, 2016

Example (for dummies):

$(document).ready(function() {
    $('[title]').tooltipster({
        interactive: true,
        contentAsHTML: true, // !
        functionInit: function(instance, helper) {
            var content = instance.content();
            content = content.replace(/\n/gm, '<br />'); // «&#10;» = «\n»
            instance.content(content);
        }
    });
});
Read more comments on GitHub >

github_iconTop Results From Across the Web

new line without <br> tag - html - Stack Overflow
You can use the <pre> tag to keep the line breaks. <pre> lorem ipsum lorem ipsum lorem ipsum </pre>. The default style for...
Read more >
How to break line without using <br> tag in HTML / CSS
Use block-level elements to break the line without using <br> tag. There are many ways to break the line without using <br> tag....
Read more >
HTML Line Break – How to Break a Line with the HTML <br ...
In this tutorial, I'm going to show you how to insert line breaks in your HTML code with some "with and without" examples,...
Read more >
<br>: The Line Break element - HTML - MDN Web Docs - Mozilla
The <br> element has a single, well-defined purpose — to create a line break in a block of text. As such, it has...
Read more >
line-break - CSS-Tricks
It's ideal for languages that might not use spaces or punctuation to separate words. The spec says that CSS does not define soft...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found