1
I’m trying to put a text with more than a paragraph as a link, but the display within the tag <a>
removes the line breaks in the text. I’m doing it this way:
<a style="cursor: pointer;" onclick="wpquery_link_filter(' <?= preg_replace('/\s+/', ' ', $value) ?> ', <?= $property['id'] ?>)">
<?= $value ?>
</a>
I’m getting something like this:
Lorem ipsum dolor sit Amet, consectetur adipiscing Elit. Integer without magna, eleifend id hendrerit vel, imperdiet sit Amet ligula. Cras eleifend quam vel ex fringilla fringilla. Phasellus at nibh eget lorem ullamcorper faucibus tristique eu purus. Donec wanted turpis door, posuere mauris wanted, Lementum an urn. Nunc Maximus neque feugiat, pretium eros egestas, just varius. Proin accumsan Fringilla sapien ut varius. Cras non finibus nisi, eu pretium Lacus. Pellentesque Elementum Maximus erat ut posuere. Vivamus elementum mauris et nisl ullamcorper, quis suscipit ipsum tempor. Proin sit amet dolor quam. Cras mattis malesuada dui. Morbi ac massa a odio facilisis vehicula. Sed a diam sed nisl egestas fermentum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vestibulum varius nec nibh at hendrerit. Quisque augue urna, lobortis ut Cursus sed, Bibendum sed Orci. Donec Maximus, erat ut Elentum porttitor, erat Elit Fringilla enim, at imperdiet odio urna nec lorem. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut vitae sem dignissim, consequat metus non, vehicula augue. Donec wanted nisl sit Amet erat auctor Tempus. Proin at sollicitudin turpis, sit Amet vestibulum leo. Nunc Tellus erat, consectetur a posuere non, aliquet id sem.
How can I make the display remain as the original text?
Thanks for the tip, after searching more I found a way to do using a CSS property. Property
white-space: pre-wrap
, but your solution would also work.– Andre Alvim
actually, it can use the <pre> tag with the link inside
– Murilo Melo