Giter Club home page Giter Club logo

Comments (5)

funkyfuture avatar funkyfuture commented on August 24, 2024 1

i've been thinking that whitespace would make a good major topic for the 0.5 version. and, instead of relying on libxml specifics, we can implement serialization natively. that's to be engineered for the Rust implementation anyway and we can look at the API design (pretty-formatted string representations? always move all namespace declarations to the root node when serializing a document?).

from delb-py.

funkyfuture avatar funkyfuture commented on August 24, 2024 1

the last cell in the docs/getting_started.ipynb also gives a great example where pretty is broken. so that demo-case could be taken as one test.

from delb-py.

funkyfuture avatar funkyfuture commented on August 24, 2024 1

i started looking into this which led me to realise that the serialization doesn't consider the xml:space attribute yet.

from delb-py.

funkyfuture avatar funkyfuture commented on August 24, 2024

after taking a few superficial glances, just some open ended threads:

  • the _collapse_whitespace method implements the recommendations linked in Document.collapse_whitespace, iirc
  • i assume that these recommendations generally make sense for text documents
  • i also assume that remove_blank_text is rather harsh in its doings, i guess i would have used that option if it was compatible with the aforementioned recommendations
  • does lxml's pretty serialization comply with these recommendations?
  • a serialization must not add whitespace here, for example: la<hi rendition="u">la</hi>la
  • can we agree that a pretty serialization must yield a result that is, when again parsed with the collapse_whitespace option, identical to the parsing of an unpretty Serialisat?

from delb-py.

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.