Comments (4)
The example program
#!/usr/bin/env python3
from odfdo import Document, Paragraph
mydoc = Document('BugOdfdo.odt')
content = mydoc.get_part('content')
mydoc.save(target='BugOdfdo2.odt', pretty=True)
from odfdo.
Here is the example input ODT
BugOdfdo.odt
from odfdo.
Maybe it is a bug in LibreOffice.
When I look at content.xml
there is nothing different, except for the white space (pretty print).
from odfdo.
Hi, thanks for this interesting bug. Actually I'm not sure to remember of what should be the correct interpretation of the standard. But a few first thoughts:
- as main ODF implementation, let's consider LibreOffice as "always right"...
- I'm surprised the pretty option breaks things, however maybe I use it mainly to analyse and debug the XML result, not in actual production code,
- the ODF standard says: http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html at "3.18White Space Processing and EOL Handling" that "ODF processing of whitespace characters is in conformance with the provisions of XML, ..." but this can be quite complex (ODF uses the "tail" part of XML tags, aka the text after the tag itself...), and ODF has a special feature for multiple white chars. And if I remember, XML knows about "significant" and "insignificant" whitespaces (thus allowing the pretty output?). Thus a whitespace at "tail" position of a Span inside a paragraph, between Span tags is unclear for me. Should be insignificant as XML, but maybe still significant in ODF ?
- As a result, at least, I should add some information about the pretty print to possibly breaks the rendering in major ODF softwares.
from odfdo.
Related Issues (20)
- Any method for updating User Fields in an exiting Document? HOT 1
- How to suppress number of headers and limit TOC depth? HOT 2
- 'DrawFillImage' object has no attribute 'family' HOT 2
- Referenced scripts from `test_scripts.sh` missing? HOT 1
- to be done: add recipe about sear/replace in .odt file
- to be done: add some explicit manual break-page example
- How to update a TOCs (or any updateable field) HOT 6
- Provide changelog HOT 1
- ImportError: cannot import name '_ElementStringResult' from 'lxml.etree' HOT 4
- Manipulating Chart Data with odfdo HOT 4
- Spreadsheet document with style not correctly visualized in LibreOffice HOT 3
- Numbered Lists HOT 1
- Underlining not working? HOT 2
- not able to read custom shapes
- Multi-line and\or tabbed Paragraph HOT 5
- `Table.traverse()` is extremely slow when table has many blanks HOT 2
- `DateTime.decode` doesn't handle timezones properly HOT 2
- Method para.append_plain_text() trims whitespaces before text HOT 4
- Deleting content from one point to another in a odt document HOT 2
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 odfdo.