Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap popover hides line breaks

I am using the html code as follows to show the bootstrap popover

<a data-original-title="" data-content="Hi,            Welcome !             Sincerely,              programmer            "    data-placement="bottom">     content </a> 

And I initialized the popover as follows

$(this).popover({             html:true         }); 

All works fine but the problem is the content available in data-content not displayed with the spaces....It removes all the new lines and show it in the single line ....How can i overcome this....

like image 439
Aravindhan Avatar asked Jan 22 '13 13:01

Aravindhan


2 Answers

You need to use <br/> for new line in html or use a <pre> tag

Ensure the data-html="true" attribute is present.

like image 180
Arun P Johny Avatar answered Sep 20 '22 12:09

Arun P Johny


You can use white-space: pre-wrap; to preserve line breaks in formatting. There is no need to manually insert html elements.

.popover {     white-space: pre-wrap;     } 
like image 29
AncientSyntax Avatar answered Sep 17 '22 12:09

AncientSyntax