From ced58cce1fae558e07b6253281601524c212533b Mon Sep 17 00:00:00 2001 From: Gioele Barabucci Date: Thu, 18 Nov 2010 11:06:37 +0100 Subject: Split long paragraphs inside flat ODT files Flat ODT files usually contain very long paragraphs. As each `` is put on its own line, these `.fodt` files end up containing very long lines. Long lines in XML files cause problems when using flat ODT files in text-oriented SCM systems like git or when opening these files in XML editors. A very simple yet XML-compliant approach to make these lines shorter is to, during the XML serialization, output a newline instead of a space every N spaces (only inside paragraphs, if you want to be conservative). Files created using this method are, from an XML point of view, equivalent to the currently created `.fodt` files. Their files size is also identical. --- filter/source/odfflatxml/odfflatxmlexport.xsl | 2 + filter/source/odfflatxml/split-long-lines.xsl | 87 +++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 0 deletions(-) create mode 100644 filter/source/odfflatxml/split-long-lines.xsl diff --git a/filter/source/odfflatxml/odfflatxmlexport.xsl b/filter/source/odfflatxml/odfflatxmlexport.xsl index e08afd7..2c1ea97 100644 --- a/filter/source/odfflatxml/odfflatxmlexport.xsl +++ b/filter/source/odfflatxml/odfflatxmlexport.xsl @@ -11,4 +11,6 @@ application/vnd.oasis.opendocument.graphics + + diff --git a/filter/source/odfflatxml/split-long-lines.xsl b/filter/source/odfflatxml/split-long-lines.xsl new file mode 100644 index 0000000..cdf9f73 --- /dev/null +++ b/filter/source/odfflatxml/split-long-lines.xsl @@ -0,0 +1,87 @@ + + + + 5 + + + + + + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + + + + -- 1.7.3.2 From 51e5ff0d4bd738fc69c2ded044339a6872dc0614 Mon Sep 17 00:00:00 2001 From: Gioele Barabucci Date: Thu, 18 Nov 2010 11:22:20 +0100 Subject: Also split `` elements --- filter/source/odfflatxml/split-long-lines.xsl | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/filter/source/odfflatxml/split-long-lines.xsl b/filter/source/odfflatxml/split-long-lines.xsl index cdf9f73..a5bb8e6 100644 --- a/filter/source/odfflatxml/split-long-lines.xsl +++ b/filter/source/odfflatxml/split-long-lines.xsl @@ -36,6 +36,13 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + + 0 + + + + -- 1.7.3.2 From 4c70e80e9dbe0c2b258c64e733792dcec1739d77 Mon Sep 17 00:00:00 2001 From: Gioele Barabucci Date: Thu, 18 Nov 2010 11:23:29 +0100 Subject: Unification of `` and `` code paths --- filter/source/odfflatxml/split-long-lines.xsl | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/filter/source/odfflatxml/split-long-lines.xsl b/filter/source/odfflatxml/split-long-lines.xsl index a5bb8e6..b514e28 100644 --- a/filter/source/odfflatxml/split-long-lines.xsl +++ b/filter/source/odfflatxml/split-long-lines.xsl @@ -30,13 +30,14 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - 0 - - + + + + + 0 -- 1.7.3.2