I had the same problem. The other variable that has in impact on indentation in html files is org-html-indent
. I fixed this by changing the variablesetting it to true in my config file: (setq org-html-indent. t)
. The docs say that this should break it (in most cases), so you may just need to switch it to the opposite value of whatever you have it.
From the docs:
org-html-indent is a variable defined in ‘ox-html.el’. Its value is nil
Documentation: Non-nil means to indent the generated HTML. Warning: non-nil may break indentation of source code blocks.