Packetanalyzer has already answered your question, but here are a couple other options just in case
.
The simple solution would be to use a <pre> tag around the pasted content (eg: <pre>content</pre>).
Demo Code (save as demo.html):
<!DOCTYPE html>
<html>
<head>
<title>Pre tag demo</title>
</head>
<body>
<pre>
This is a demo of a pre tag. Pre standing for pre-formatted.
As you can see there isn't a single br tag in use, but the
text isn't all appearing on a single line. :)
</pre>
</body>
</html>
A more advanced solution would be to use a text-substitution tool to replace newlines with <br> tags. I'm assuming you're using Windows, for which I'm unfamilair with the available tools, but on the off chance you're using GNU/Linux, you can use the below example (provided Sed, Tr, and Cat are installed on your distro). You'll need to substitute the correct file path and name for
both the input and the output text files, substitute the "~" in the tr command for a character that isn't used in the document anywhere (you can keep it as a "~" if that fits the bill), and lastly copy the outputted content from the output text file into your html page.
Example Substitution Command Using Tr & Sed:
cat ~/input.txt | tr "\n" "~" | sed 's/~/<br>/g' > ~/output.txt
(This can be done directly with Sed, no need for Tr, making it much easier, but that's beyond my skillz.)
Demo Code (save as demo.html):
<!DOCTYPE html>
<html>
<head>
<title>Br tag demo</title>
</head>
<body>
This is a demo of a pre tag. Pre standing for pre-formatted.<br>As you can see there isn't a single br tag in use, but the<br>text isn't all appearing on a single line. :)<br>
</body>
</html>
Edited by hollowface, 21 October 2015 - 01:29 AM.