[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] HTML export doesn't convert quote before footnote
From: |
James Harkins |
Subject: |
Re: [O] HTML export doesn't convert quote before footnote |
Date: |
Thu, 09 Jan 2014 11:03:25 +0800 |
User-agent: |
Trojita/v0.3.96-git; Qt/4.8.1; X11; Linux; Ubuntu 12.04.3 LTS |
On Thursday, January 9, 2014 10:13:32 AM HKT, James Harkins wrote:
OK, I'll work around it on my side.
Continuing... I've tried to write a filter for this, but I'm stuck on
choosing strings based on the backend name.
(cdr (assoc
(org-export-backend-name backend)
'((latex . "\"\\footnote") (html . "\"<sup><a"))))
Apparently org-export-backend-name returns neither a symbol nor a string.
What does it return? Or, what is the right way to look up a value based on
the backend name?
hjh
(defun hjh-quote-before-footnote (contents backend info)
"Convert '\"[fn' to the appropriate closing quote per backend."
(when (and (and
(org-export-derived-backend-p backend 'latex 'html)
(plist-get info :with-smart-quotes))
(let ((teststring
(cdr (assoc
(org-export-backend-name backend)
'((latex . "\"\\footnote") (html . "\"<sup><a"))))))
(string-match teststring contents)))
(let ((replacements '((latex . "''[fn") (html . "”[fn")))
(replacement (assoc (org-export-backend-name backend) replacements)))
(replace-match (cdr replacement) nil nil contents))))