Open RockyMM opened 7 years ago
Sorry for the late reply.
I addressed this issue in https://github.com/eerohele/exalt/issues/1#issuecomment-233311727.
I would like to leave this ticket open - it's really like sand in shoes having tabs as 2 spaces :) I'll pursue solution from within lxml.
Sure thing! If you find anything, please let me know and I'll definitely see about implementing it.
There was a post on Hacker News a couple a days ago about a single-file Python XML formatter that might be serve as alternative solution. I'll see if I can find it.
Maybe this http://effbot.org/zone/element-lib.htm#prettyprint? Even lxml mentions this element library.
I have to admit that I'm Python noob so I'm not sure how usable this might be for you.
The thing is that other than defining the indent width, lxml
's pretty-printer works really well. Most other pretty-printers seem to rely on regular expressions and fall apart pretty quickly. That's why it's not necessarily very easy to find a replacement for lxml
.
lxml seems to be calling the C code in here https://github.com/ConradIrwin/libxml2/blob/master/HTMLtree.c
Doesn't seem like an easy fix which seems crazy given how common an indent_spaces
type param is for pretty printing functionality
Yep, the situation is really perplexing. I guess I have to live with it and do some post find/replace myself :|
On Windows, Sublime 3143, Exalt 0.3.3 when I format an XML the tabs are 2 spaces instead of 4 as it is specified in the default Sublime preferences.