pelican-plugins / image-process

Pelican plugin that automates image processing
GNU Affero General Public License v3.0
53 stars 22 forks source link

HTML Indentation #84

Open mitten opened 2 days ago

mitten commented 2 days ago

As best as I can see, when the plugin does its magic, it also strips all the indentation from the HTML in the process. Is there a way to stop it from doing that? I prefer having the indentation in my HTML (it helps me read it better) - is there a way to have it not strip the tabs out?

mitten commented 1 day ago

I continued digging around in the plugin code and the BS4 documentation, and found that at the end of the "harvest_feed_images" function, if you change f.write(str(soup)) to f.write(str(soup.prettify())) , it does a decent job of indenting the HTML output. Not absolutely perfect, but way better than the flat output.

Maybe this could be added as an option setting in the plugin?