emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "David Lukeš" <dafydd.lukes@gmail.com>
To: theophilusx@gmail.com, diego.vincent.rodriguez@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: CDATA auto aggregation
Date: Thu, 29 Sep 2022 13:58:51 +0200	[thread overview]
Message-ID: <87r0zuqtms.fsf@gmail.com> (raw)
In-Reply-To: 87ee72l8e6.fsf@gmail.com

Diego Rodriguez <diego.vincent.rodriguez@gmail.com> writes:

> Where does this CDATA tag gets added automatically and how can I modify this behavior?

Do you have auto-formatting on save configured in Emacs -- perhaps even
via a starter kit like Doom Emacs, so that you're only half aware of it?
And are you by any chance on macOS, which ships with the tidy program
(HTML Tidy) by default? Or failing that, did you install it manually?

To cut a long-story short: HTML auto-formatting on save runs tidy, which
mangles the HTML in various ways, including this CDATA thing. This also
happens in buffers with generated Org export output.

I posted the long version to the mailing list in February:
https://list.orgmode.org/CAEPTPEwOZjJLX1jyFmVR6jarsocyuD=Zf7HJ1i9G4SfWk4mUpQ@mail.gmail.com/

I suggested a patch, but it probably got buried in the noise:
https://list.orgmode.org/20220228140750.75761-1-dafydd.lukes@gmail.com/

Instead, I see that another fix was merged yesterday (for different
reasons AFAICS, but it should help with this auto-formatting issue too):
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=d7a55bbd537314d2776b082bd92a1a08b3edc84e

This should be enough for HTML exports, but two more tweaks are needed
for ODT exports in ox-odt.el -- see my original patch. Or use
https://github.com/kjambunathan/org-mode-ox-odt, which has already
incorporated them.

Tim Cross <theophilusx@gmail.com> writes:

> We probably should consider moving the existing ox-html to an ox-xhtml
> and implementing a new ox-html that is based on html5.

+1 on that, although obviously, I'm aware it's quite a chore.

Best,

David


             reply	other threads:[~2022-09-29 13:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 11:58 David Lukeš [this message]
2022-09-30  3:14 ` CDATA auto aggregation Ihor Radchenko
2022-10-01  5:13   ` David Lukeš
2022-10-02  3:35     ` Ihor Radchenko
2022-10-02  4:04       ` David Lukeš
  -- strict thread matches above, loose matches on Subject: below --
2021-11-24 17:58 Diego Rodriguez
2021-11-27  0:54 ` Tim Cross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0zuqtms.fsf@gmail.com \
    --to=dafydd.lukes@gmail.com \
    --cc=diego.vincent.rodriguez@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=theophilusx@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).