* Form feed characters break odt export
@ 2024-12-21 1:48 Joseph Turner via General discussions about Org-mode.
2024-12-21 3:56 ` Max Nikulin
2024-12-23 17:32 ` Ihor Radchenko
0 siblings, 2 replies; 7+ messages in thread
From: Joseph Turner via General discussions about Org-mode. @ 2024-12-21 1:48 UTC (permalink / raw)
To: Org Mode Mailing List; +Cc: Bohong Huang
Tested on
GNU Emacs 29.4 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41, cairo version 1.18.0)
Org mode version 9.7.6 (9.7.6-7a4527 @ /home/joseph/.emacs.d/elpa/org-9.7.6/)
I can export the following Org content to a .odt file, but the exported
file cannot be opened ("Read Error. Format error discovered in the file
in sub-document content.xml at 368,2(row,col).")
--8<---------------cut here---------------start------------->8---
#+TITLE: Foo
* Bar
Baz
\f
--8<---------------cut here---------------end--------------->8---
First reported by bohonghuang:
https://github.com/bohonghuang/org-srs/pull/10#issuecomment-2557417871
Thanks!
Joseph
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Form feed characters break odt export
2024-12-21 1:48 Form feed characters break odt export Joseph Turner via General discussions about Org-mode.
@ 2024-12-21 3:56 ` Max Nikulin
2024-12-21 6:52 ` Joseph Turner
2024-12-23 17:32 ` Ihor Radchenko
1 sibling, 1 reply; 7+ messages in thread
From: Max Nikulin @ 2024-12-21 3:56 UTC (permalink / raw)
To: Joseph Turner, emacs-orgmode; +Cc: Bohong Huang
On 21/12/2024 08:48, Joseph Turner wrote:
>
> I can export the following Org content to a .odt file, but the exported
> file cannot be opened ("Read Error. Format error discovered in the file
> in sub-document content.xml at 368,2(row,col).")
[...]
> First reported by bohonghuang:
> https://github.com/bohonghuang/org-srs/pull/10#issuecomment-2557417871
In this specific context a workaround should be
#+begin_comment
^L
#+end_comment
Or a commented out empty local variables block above.
I have wrote already that I do not like non-printable characters in Org
files.
I admit that special characters either should cause `org-lint' warnings
or should be filtered out by exporters.
Specifically to ^L, there was a request to treat it as a page break by
all exporters (I would prefer some entity or macro instead to not
deviate from plain text markup).
Marvin Gülker. Feature request: export form feed as page break. Sat, 21
Oct 2023 09:42:33 +0200.
<https://list.orgmode.org/87zg0ce6yi.fsf@guelker.eu>
I have not had a close look at another proposed feature, but I suspect
that it might make filtering special characters more tricky. (I would be
happy to hear that I am wrong.)
Nathaniel Nicandro. [PATCH] ANSI color on example blocks and fixed width
elements. Wed, 05 Apr 2023 07:03:43 -0500.
<https://list.orgmode.org/874jpuijpc.fsf@gmail.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Form feed characters break odt export
2024-12-21 3:56 ` Max Nikulin
@ 2024-12-21 6:52 ` Joseph Turner
2024-12-21 7:23 ` Max Nikulin
0 siblings, 1 reply; 7+ messages in thread
From: Joseph Turner @ 2024-12-21 6:52 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Bohong Huang, Max Nikulin
Max Nikulin <manikulin@gmail.com> writes:
> On 21/12/2024 08:48, Joseph Turner wrote:
>> I can export the following Org content to a .odt file, but the
>> exported
>> file cannot be opened ("Read Error. Format error discovered in the file
>> in sub-document content.xml at 368,2(row,col).")
> [...]
>> First reported by bohonghuang:
>> https://github.com/bohonghuang/org-srs/pull/10#issuecomment-2557417871
>
> In this specific context a workaround should be
>
> #+begin_comment
> ^L
> #+end_comment
Thank you! Or even simpler:
# ^L
> Or a commented out empty local variables block above.
>
> I have wrote already that I do not like non-printable characters in
> Org files.
I agree that they make Org files less portable outside Emacs, and they
complicate org-export.
> I admit that special characters either should cause `org-lint'
> warnings or should be filtered out by exporters.
>
> Specifically to ^L, there was a request to treat it as a page break by
> all exporters (I would prefer some entity or macro instead to not
> deviate from plain text markup).
>
> Marvin Gülker. Feature request: export form feed as page break. Sat,
> 21 Oct 2023 09:42:33 +0200.
> <https://list.orgmode.org/87zg0ce6yi.fsf@guelker.eu>
>
> I have not had a close look at another proposed feature, but I suspect
> that it might make filtering special characters more tricky. (I would
> be happy to hear that I am wrong.)
Yes. Without digging into it, my gut feeling is also that handling one
non-printable character specially would open Pandora's box.
> Nathaniel Nicandro. [PATCH] ANSI color on example blocks and fixed
> width elements. Wed, 05 Apr 2023 07:03:43 -0500.
> <https://list.orgmode.org/874jpuijpc.fsf@gmail.com>
Gratefully,
Joseph
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Form feed characters break odt export
2024-12-21 6:52 ` Joseph Turner
@ 2024-12-21 7:23 ` Max Nikulin
2024-12-21 19:06 ` Joseph Turner
0 siblings, 1 reply; 7+ messages in thread
From: Max Nikulin @ 2024-12-21 7:23 UTC (permalink / raw)
To: Joseph Turner, emacs-orgmode; +Cc: Bohong Huang
On 21/12/2024 13:52, Joseph Turner wrote:
> Max Nikulin writes:
>>
>> #+begin_comment
>> ^L
>> #+end_comment
> Thank you! Or even simpler:
>
> # ^L
It was first I tried, but Emacs-28.2 demands to decide if Local
Variables should be applied.
You may ask Emacs developers for a *plain text* spell to stop processing
of local variables (or to take *last* found block).
Notice that commit diff looks confusing.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Form feed characters break odt export
2024-12-21 7:23 ` Max Nikulin
@ 2024-12-21 19:06 ` Joseph Turner
0 siblings, 0 replies; 7+ messages in thread
From: Joseph Turner @ 2024-12-21 19:06 UTC (permalink / raw)
To: emacs-orgmode; +Cc: Bohong Huang, Max Nikulin
Max Nikulin <manikulin@gmail.com> writes:
> On 21/12/2024 13:52, Joseph Turner wrote:
>> Max Nikulin writes:
>>>
>>> #+begin_comment
>>> ^L
>>> #+end_comment
>
>> Thank you! Or even simpler:
>> # ^L
>
> It was first I tried, but Emacs-28.2 demands to decide if Local
> Variables should be applied.
Oops! You're right. The form feed needs to be at the beginning of the line.
> You may ask Emacs developers for a *plain text* spell to stop
> processing of local variables (or to take *last* found block).
Good idea:
https://yhetil.org/emacs-devel/87ttawewpx.fsf@breatheoutbreathe.in/T/#u
> Notice that commit diff looks confusing.
Joseph
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Form feed characters break odt export
2024-12-21 1:48 Form feed characters break odt export Joseph Turner via General discussions about Org-mode.
2024-12-21 3:56 ` Max Nikulin
@ 2024-12-23 17:32 ` Ihor Radchenko
2024-12-24 11:04 ` Christian Moe
1 sibling, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2024-12-23 17:32 UTC (permalink / raw)
To: Joseph Turner; +Cc: Org Mode Mailing List, Bohong Huang
Joseph Turner via "General discussions about Org-mode."
<emacs-orgmode@gnu.org> writes:
> I can export the following Org content to a .odt file, but the exported
> file cannot be opened ("Read Error. Format error discovered in the file
> in sub-document content.xml at 368,2(row,col).")
>
> --8<---------------cut here---------------start------------->8---
> #+TITLE: Foo
> * Bar
> Baz
> \f
> --8<---------------cut here---------------end--------------->8---
Looks like ^L is not allowed in ODT files.
However, I see no such information on
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html
May somebody check if there is an official list of unsupported
characters in ODT? Or maybe it is simply a bug in LibreOffice?
--
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Form feed characters break odt export
2024-12-23 17:32 ` Ihor Radchenko
@ 2024-12-24 11:04 ` Christian Moe
0 siblings, 0 replies; 7+ messages in thread
From: Christian Moe @ 2024-12-24 11:04 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Joseph Turner, Org Mode Mailing List, Bohong Huang
(re-sending to include the list, apologies, recent mu4e ui changes keep
tripping me up)
Ihor Radchenko <yantar92@posteo.net> writes:
> Joseph Turner via "General discussions about Org-mode."
> <emacs-orgmode@gnu.org> writes:
>
>> I can export the following Org content to a .odt file, but the exported
>> file cannot be opened ("Read Error. Format error discovered in the file
>> in sub-document content.xml at 368,2(row,col).")
>>
>> --8<---------------cut here---------------start------------->8---
>> #+TITLE: Foo
>> * Bar
>> Baz
>> \f
>> --8<---------------cut here---------------end--------------->8---
>
> Looks like ^L is not allowed in ODT files.
> However, I see no such information on
> http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html
>
> May somebody check if there is an official list of unsupported
> characters in ODT? Or maybe it is simply a bug in LibreOffice?
I don't think it's specific to ODT or LibreOffice, it's the underlying
XML 1.0 spec that "discourages" control characters and does not include
#xC in the range of characters that XML processors must accept.
Spec: https://www.w3.org/TR/REC-xml/#charsets
Some discussion:
https://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
Yours,
Christian
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-12-24 11:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-21 1:48 Form feed characters break odt export Joseph Turner via General discussions about Org-mode.
2024-12-21 3:56 ` Max Nikulin
2024-12-21 6:52 ` Joseph Turner
2024-12-21 7:23 ` Max Nikulin
2024-12-21 19:06 ` Joseph Turner
2024-12-23 17:32 ` Ihor Radchenko
2024-12-24 11:04 ` Christian Moe
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).