Skip to main content
added 774 characters in body
Source Link
JaredL
  • 121
  • 3

Went through the source code and it does not look like this is something you can change. However, I did find a way around it by just ignoring the `contentscontents argument and re-creating it myself by calling org-export-data on each of the AST node's contents, then joining them together. The backend machinery memoizes the results of exporting each node so this doesn't create a lot of extra work.

The resulting function looks like this:

(defun export-contents (node info)
  (format "[\n%s\n]"
    (s-join ",\n"
      (cl-loop
        with encoded-items = nil
        for item in (org-element-contents node)
        do (let ((encoded (org-export-data item info)))
             (unless (s-blank? encoded)
               (push encoded encoded-items)))
        finally return (nreverse encoded-items)))))

(defun transcode-some-element(node contents info)
  (setq contents (export-contents node info)
  ...

Went through the source code and it does not look like this is something you can change. However, I did find a way around it by just ignoring the `contents

Went through the source code and it does not look like this is something you can change. However, I did find a way around it by just ignoring the contents argument and re-creating it myself by calling org-export-data on each of the AST node's contents, then joining them together. The backend machinery memoizes the results of exporting each node so this doesn't create a lot of extra work.

The resulting function looks like this:

(defun export-contents (node info)
  (format "[\n%s\n]"
    (s-join ",\n"
      (cl-loop
        with encoded-items = nil
        for item in (org-element-contents node)
        do (let ((encoded (org-export-data item info)))
             (unless (s-blank? encoded)
               (push encoded encoded-items)))
        finally return (nreverse encoded-items)))))

(defun transcode-some-element(node contents info)
  (setq contents (export-contents node info)
  ...
Source Link
JaredL
  • 121
  • 3

Went through the source code and it does not look like this is something you can change. However, I did find a way around it by just ignoring the `contents