See following examples for an illustration of the problem.
Created attachment 431238 [details]
Save as bug.tex and generate PDF and HTML output:>
$ pdflatex bug
$ mk4ht xhlatex bug
Created attachment 431240 [details]
PDF output, for reference how it should look like
Created attachment 431242 [details]
Generated HTML output
Created attachment 431244 [details]
Generated CSS output
So, two problems:
1. Line numbers should be right aligned but aren't.
2. Lines of code are not indented at all.
Reported upstream: https://puszcza.gnu.org.ua/bugs/index.php?314
Fixed in upstream repository:
Author: Alexis Ballier <firstname.lastname@example.org>
Date: Wed Feb 8 17:31:59 2017 +0100
dev-tex/tex4ht: Another revbump to update texmf files from texlive 2016, fixing bug #580532
I can confirm that this fixes the problem.