in reply to Re^2: Formatting Input
in thread Formatting Input

The problem is that you don't know how HTML works. Consecutive whitespace, such as your line breaks, is collapsed into a single space for display purposes.

That means before you print your variable contents in HTML, you need to prepare it appropriately. For example, you could wrap whole paragraphs of text into a <p>…</p> element.

Replies are listed 'Best First'.
Re^4: Formatting Input
by akwe-xavante (Acolyte) on Jun 14, 2012 at 17:15 UTC

    As far as i can see it is when written back to the browser and into the email. It isn't when printed to the PDF Document though

    <p>$Contents</p>
      Unclear, ambiguous, lacking a clear antecedent to both instances of "it." Downvoted for that very serious shortcoming.

      You're wrapping the whole string (several paragraphs) into a single HTML paragraph tag. The grandparent was suggesting that you parse the string for paragraphs and manually insert the necessary paragraph tags.

      Do look at the HTML source your program generates and check that everything is there. You may also want to try white-space: pre; if you want a boring CSS solution (but nothing compares to actually understanding the problem!)