format output from pre/post commands

i've got a script running post creation and post deletion which echos some messages, this works fine when executed manually from the shell, but when the messages get display by webmin they all on the same line. I could include
's in the messages, but thats horrible.

Could you wrap the messages returned from per/post commands in a

<

pre> tag or css equivalent ?

example output

Deleted tomcat host config file /opt/tomcat/conf/vhosts/test3.com.xml
Updating tomcat vhost configuration /opt/tomcat/conf/vhosts-include.xml
Restarting tomcat
Stoping Tomcat
waiting for processes to exit
Starting tomcat
Tomcat started.
Tomcat is running with pid: 11178

ends up looking like

Deleted tomcat host config file /opt/tomcat/conf/vhosts/test3.com.xml Updating tomcat vhost configuration /opt/tomcat/conf/vhosts-include.xmlRestarting tomcatStopingTomcatwaiting for processes to exitStarting tomcatTomcat started.Tomcat is running with pid: 11178

Status: 
Active

Comments

You could include HTML tags in the post-command output, like <br> to indicate a newline.

I did mention that in my OP, but the <br> got lost in the post. I could do that, but then I get them on the command line when I use the tool outside virtualmin.

Perhaps have the command check it's environment to see if it is being executed via virtualmin or not, and modify the output appropriate?