0

I want to convert the output of a shell command to HTML, regardless of what the command prints.
I've tried using txt2html and pandoc but the first will not keep lines of hypens, even with the --nounhipenation param, and also formatting tags like < h1 > to some lines.

with txt2html this output:

TEST: SimpleTest
-----------------------------------
 All test completed in 1ms
 Warning: No asserts run!
 All assert(s) passed.
-----------------------------------

becomes:

<h1>TEST: SimpleTest</h1>
<p> All test completed in 1ms<br/>
 Warning: No asserts run!<br/>
 All assert(s) passed.
</p><hr/>

Notice the missing hypens and the spurious < h1 > < /h1 > and for some reason < hr/ > tags.

I would like it to output something like:

<p>TEST: SimpleTest<br/>
-----------------------------------<br/>
 All test completed in 1ms<br/>
 Warning: No asserts run!<br/>
 All assert(s) passed.
-----------------------------------<br/>
</p>
NeonMan
  • 623
  • 10
  • 24

1 Answers1

0

I have done this before and the following has worked for me.

http://2partsmagic.com/util/text2html.jsp

JD Vangsness
  • 697
  • 3
  • 10
  • 27
  • While this solution works, I'm trying to make the conversion inside a shell script, probably offline for weeks, so webpages are a no-go. – NeonMan Feb 04 '14 at 01:38