emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@gmail.com>
To: orgmode <emacs-orgmode@gnu.org>
Subject: Re: HTML export doesn't convert quote before footnote
Date: Thu, 09 Jan 2014 11:03:25 +0800	[thread overview]
Message-ID: <8b247f17-020f-4738-8198-f864301f4bd7@dewdrop-world.net> (raw)
In-Reply-To: <3388e888-389f-4963-843f-4c3508e59bd8@dewdrop-world.net>

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 . "&rdquo;[fn")))
	  (replacement (assoc (org-export-backend-name backend) replacements)))
      (replace-match (cdr replacement) nil nil contents))))

  reply	other threads:[~2014-01-09  3:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-08  2:09 HTML export doesn't convert quote before footnote James Harkins
2014-01-08  5:03 ` Nick Dokos
2014-01-08 15:33 ` Nicolas Goaziou
2014-01-08 15:50   ` James Harkins
2014-01-08 16:37     ` Nicolas Goaziou
2014-01-09  2:13       ` James Harkins
2014-01-09  3:03         ` James Harkins [this message]
2014-01-09 11:07           ` Nicolas Goaziou
2014-01-11  2:45             ` James Harkins

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=8b247f17-020f-4738-8198-f864301f4bd7@dewdrop-world.net \
    --to=jamshark70@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).