Comments (5)
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.
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.
i started looking into this which led me to realise that the serialization doesn't consider the xml:space
attribute yet.
from delb-py.
after taking a few superficial glances, just some open ended threads:
- the
_collapse_whitespace
method implements the recommendations linked inDocument.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)
- Proposal to rename the 'master' branch to 'main'
- Find ideas on addressing namespaced attributes HOT 3
- Proposal for a method that creates a branch of nodes if it doesn't exist yet HOT 3
- Frequently asked questions
- Differentiate exceptions
- Is the insertion order of NodeBase.add_previous the intuitive behavior? HOT 1
- Plugins: drop PluginManager.register_document_extension in favor of DocumentMixinHooks.__init_sublass__
- Create a GH workflow for releases HOT 2
- QueryResults identity HOT 6
- Evaluate just as task runner HOT 1
- Add an include_namespaces attribute to the TagNode.xpath method HOT 3
- Test loaders in a separate target
- Regarding the names of methods that refer to other nodes HOT 1
- Regarding the handling of IRIs as XML namespaces
- Missing parts in the online API docs HOT 1
- descendant-or-self axis in TagNode.xpath method HOT 4
- should sample files for tests/benchmarks be included in sdist bundle? HOT 1
- drop python 3.7 support HOT 2
- Make use of pyproject-fmt HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from delb-py.