I have the following code within an org file:
#+BEGIN_SRC emacs-lisp :exports both :results none :eval export
(defun my-html-body-onload-filter (output backend info)
"Add my onload attribute to<body> tag, if any."
(when (and (eq backend 'html)
(string-match "<body>\n" output))
(replace-match "<body onLoad=\"setUp();\">\n" nil nil output)))
(add-to-list 'org-export-filter-final-output-functions
'my-html-body-onload-filter)
#+END_SRC
The problem with this setup is that it permanently adds this function to the list, so that every org-mode file that I export goes through the same filters.
How can I make these filters file local? I tried using the following too, but it didn't work, i.e., the export was not filtered:
# Local variables:
# eval: (add-to-list 'org-export-filter-final-output-functions 'my-html-body-onload-filter)
# End: