Coder Social home page Coder Social logo

Comments (7)

henrycjc avatar henrycjc commented on May 26, 2024 1

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

from exalt.

eerohele avatar eerohele commented on May 26, 2024

Sorry for the late reply.

I addressed this issue in #1 (comment).

from exalt.

RockyMM avatar RockyMM commented on May 26, 2024

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.

from exalt.

eerohele avatar eerohele commented on May 26, 2024

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.

from exalt.

RockyMM avatar RockyMM commented on May 26, 2024

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.

from exalt.

eerohele avatar eerohele commented on May 26, 2024

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.

from exalt.

RockyMM avatar RockyMM commented on May 26, 2024

Yep, the situation is really perplexing. I guess I have to live with it and do some post find/replace myself :|

from exalt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.