Reputation: 1208
I have a .txt file that has certain formatting. It's not too complicated:
Text heading
----
Point 1
Point 2
Result:
---
This file goes onto the server and gets displayed to a user. But when it goes there, it automatically changes the filetype to html(when originally it was just .txt) and the formatting is all gone. It becomes like
Text Heading ---- Point 1 Point 2 Result: -----
It basically gets encapsulated in a <p></p>
Is there a way to preserve the basic formatting, or do I have to manually enclose it within tags to get the formatting right
Upvotes: 1
Views: 516
Reputation: 35501
Either wrap your content in a <pre>
tag or use some css to preserve whitespace:
p {
display: block;
white-space: pre;
}
Upvotes: 2