emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] HTML export doesn't convert quote before footnote


From: Nicolas Goaziou
Subject: Re: [O] HTML export doesn't convert quote before footnote
Date: Wed, 08 Jan 2014 16:33:56 +0100

Hello,

James Harkins <address@hidden> writes:

> This appears to be an HTML export bug: A straight double-quote mark
> before a footnote fails to convert into &rdquo;
>
> Minimal example:
>
> * Heading
> Krusty the Klown opined, "Well, that's showbiz for ya."[fn:1]
> * Footnotes
> [fn:1] /The Simpsons/.
>
> Expected:
>
> <p>
> Krusty the Klown opined, &ldquo;Well, that&rsquo;s showbiz for
> ya.&rdquo;<sup><a id="fnr.1" name="fnr.1" class="footref"
> href="#fn.1">1</a></sup>
> </p>
>
> Got:
>
> <p>
> Krusty the Klown opined, &ldquo;Well, that&rsquo;s showbiz for
> ya."<sup><a id="fnr.1" name="fnr.1" class="footref"
> href="#fn.1">1</a></sup>
> </p>
>
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]