all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Herbert Sitz <hesitz@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: Directional quotes in html
Date: Tue, 6 Dec 2011 20:37:52 +0000 (UTC)	[thread overview]
Message-ID: <loom.20111206T212417-459@post.gmane.org> (raw)
In-Reply-To: 4EDE684C.7000801@christianmoe.com

Christian Moe <mail <at> christianmoe.com> writes:
> 
> Hi, Herb,
> 
> I keep this in my .emacs:
> 
> (setq org-export-html-special-string-regexps
>        (cons
>         '(" \"\\([^\"]+\\)\"" . " &ldquo;\\1&rdquo;")
>         org-export-html-special-string-regexps))
> 
> There may be a better way to do it altogether, and I'm sure the very 
> simple regexp could be improved on (in fact, I'm posting this in the 
> hope someone will improve on it), but it mostly works.
> 
> Yours,
> Christian
> 

Christian -- Thanks a lot.  If there's nothing built in to Org to do it then
that looks like a good method.  

Question: Does this work only if quotes both appear on the same line of Org-mode
text?  Or is the regex applied to paragraph as a whole after it's been assembled
as part of export?

It looks like it does only double-quotes; makes me realize single quotes are a
bit harder because they're often used alone as apostrophes.  It seems like even
single-quote pairs could work well if you put beginning-of-word (\<) and
end-of-word (\<) regex anchors in there.  

Beginning-of-word and end-of-word anchors may be appropriate even for the
double-quote search, so maybe something like change below could be improvement.
Take it for what's it's worth, since I don't do emacs regexes.

>         '("\<\"\\([^\"]+\\)\"\>" . " &ldquo;\\1&rdquo;")

-- Herb

  reply	other threads:[~2011-12-06 20:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-06 18:25 Directional quotes in html Herbert Sitz
2011-12-06 19:09 ` Christian Moe
2011-12-06 20:37   ` Herbert Sitz [this message]
2011-12-06 22:55     ` Christian Moe
2011-12-07  9:44       ` Christer Boräng
2011-12-07 10:04         ` Christian Moe
2011-12-06 21:12 ` tycho garen
2011-12-06 21:45   ` Herbert Sitz
2011-12-06 21:55   ` Jambunathan K
2011-12-07  8:58   ` Eric S Fraga

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20111206T212417-459@post.gmane.org \
    --to=hesitz@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.