Is there any way to define custom indent width for .prettify()
function? From what I can get from it\'s source -
def prettify(self, encoding=No
If you're using pycharm you can automatically reformat a html-file by pressing:
ctrl + alt + L
while having your prettified html-file open in pycharm.
This will change indentation from one space to 4, or whatever you set for html in Settings>Editor>Code Style>HTML (default = 4).
https://www.jetbrains.com/pycharm/guide/tips/reformat-code/
You would have to do this for every html-file you run prettify() on.
Sorry if I'm reviving an old thread but I had the same problem and found a simple solution.