Rendering Plaintext as HTML maintaining whitespace – without <pre>
Given any arbitrary text file full of printable characters, how can this be converted to HTML that would be rendered exactly the same (with the following requirements)? Does not rely on any but the default HTML whitespace rules No <pre> tag No CSS white-space rules <p> tags are fine, but not required ( <br /> s and/or <div> s are fine) Whitespace is maintained exactly. Given the following lines of input (ignore erroneous auto syntax highlighting): Line one Line two, indented four spaces A browser should render the output exactly the same, maintaining the indentation of the second line and the