Hello, James Harkins <jamshar...@gmail.com> 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: > > <p> > Krusty the Klown opined, “Well, that’s showbiz for > ya.”<sup><a id="fnr.1" name="fnr.1" class="footref" > href="#fn.1">1</a></sup> > </p> > > Got: > > <p> > Krusty the Klown opined, “Well, that’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