From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: HTML export doesn't convert quote before footnote Date: Wed, 08 Jan 2014 16:33:56 +0100 Message-ID: <87lhyqbi8r.fsf@gmail.com> References: <2dca3d53-10f1-4ead-8106-eb5fe050a656@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0v8c-0005iq-6V for emacs-orgmode@gnu.org; Wed, 08 Jan 2014 10:33:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W0v8T-0000Nm-Pu for emacs-orgmode@gnu.org; Wed, 08 Jan 2014 10:33:46 -0500 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:64160) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W0v8T-0000NT-Ib for emacs-orgmode@gnu.org; Wed, 08 Jan 2014 10:33:37 -0500 Received: by mail-we0-f173.google.com with SMTP id t60so1584810wes.18 for ; Wed, 08 Jan 2014 07:33:36 -0800 (PST) In-Reply-To: <2dca3d53-10f1-4ead-8106-eb5fe050a656@dewdrop-world.net> (James Harkins's message of "Wed, 08 Jan 2014 10:09:07 +0800") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: orgmode Hello, James Harkins writes: > This appears to be an HTML export bug: A straight double-quote mark > before a footnote fails to convert into ” > > Minimal example: > > * Heading > Krusty the Klown opined, "Well, that's showbiz for ya."[fn:1] > * Footnotes > [fn:1] /The Simpsons/. > > Expected: > >

> Krusty the Klown opined, “Well, that’s showbiz for > ya.” href="#fn.1">1 >

> > Got: > >

> Krusty the Klown opined, “Well, that’s showbiz for > ya." href="#fn.1">1 >

> > I guess I can filter for it as a workaround. Smart quotes mechanism is based on regexps. There are unavoidable ambiguous cases, like this one. We can pile up new rules to handle most of them, but in the end, I don't think we cannot handle them all. Worse, some advanced rules may create false positives. Anyway, here are some options : 1. Do nothing. 2. Change the closing regexp to "\\(?:\\w\\|\\s.\\|\\s_\\)\\([\"']\\)", i.e. ignore characters after the quote. But then we have to find a way to know a closing single quote from an apostrophe. 3. Do not rely on regexps but on some simple depth rules: 1. At a given level in the parse tree, the first quote is always an opening quote ; 2. Every subsequent quote in the level alternates between closing and opening state. Second option probably has its shortcomings too, but it may be sturdier. It also doesn't solve the problem of apostrophes. Regards, -- Nicolas Goaziou