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)
...