emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Diego Rodriguez <diego.vincent.rodriguez@gmail.com>
To: emacs-orgmode@gnu.org
Subject: CDATA auto aggregation
Date: Wed, 24 Nov 2021 12:58:32 -0500	[thread overview]
Message-ID: <CADGgJmqwoMx8h1tZ_ky7VUJ7RqbYw4ZCTmMbys9wW8M+m3YWOw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2273 bytes --]

Hello,

I am customizing my org-mode installation but there is something that I
don't understand.

When I execute the following statement:

```
(setq org-html-mathjax-template

"
<script type=\"text/x-mathjax-config\">
    MathJax.Hub.Config({
        displayAlign: \"%ALIGN\",
        displayIndent: \"%INDENT\",
        \"HTML-CSS\": { scale: %SCALE,
                        linebreaks: { automatic: \"%LINEBREAKS\" },
                        webFont: \"%FONT\"
                       },
        SVG: {scale: %SCALE,
              linebreaks: { automatic: \"%LINEBREAKS\" },
              font: \"%FONT\"},
        NativeMML: {scale: %SCALE},
        TeX: { equationNumbers: {autoNumber: \"%AUTONUMBER\"},
               MultLineWidth: \"%MULTLINEWIDTH\",
               TagSide: \"%TAGSIDE\",
               TagIndent: \"%TAGINDENT\"
        }
    });
</script>
<script src=\"%PATH\"></script>
")
```

A `CDATA` tag gets appended in my HTML export as shown below:

```html
  <script type="text/x-mathjax-config">
<![CDATA[
    mathjax.hub.config({
        displayalign: "center",
        displayindent: "0em",
        "html-css": { scale: 100,
                        linebreaks: { automatic: "false" },
                        webfont: "TeX"
                       },
        svg: {scale: 100,
              linebreaks: { automatic: "false" },
              font: "TeX"},
        nativemml: {scale: 100},
        tex: { equationnumbers: {autonumber: "AMS"},
               multlinewidth: "85%",
               tagside: "right",
               tagindent: ".8em"
        }
    });
  ]]>
  </script>
  <script src=
  "
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML
"
  type="text/javascript">
</script>
```

As you can see above, when I set the variable I have no CDATA tag on it.
Where does this tag come from? The problem is that the CDATA tag messes up
with the MathJax configuration parser, as it expects a JavaScript script
inside. But, instead, it finds a CDATA tag that, while it might be valid
according to W3, the MathJax parser throws an `eval` error in the console
since it tries to parse the body of that HTML node.

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

Diego Rodriguez.

[-- Attachment #2: Type: text/html, Size: 3342 bytes --]

             reply	other threads:[~2021-11-25 10:48 UTC|newest]

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

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=CADGgJmqwoMx8h1tZ_ky7VUJ7RqbYw4ZCTmMbys9wW8M+m3YWOw@mail.gmail.com \
    --to=diego.vincent.rodriguez@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).