Footnotes in RedCloth

S

Stephan Kämper

Hi all, hi _why,

I wonder what to expect from a RedCloth string in case some quoted text
or text ending in an ellpisis (...) has a footnote attached to it.

The example below shows what I mean. The 2nd footnote is rendered into
the HTML as I expected, however the 1st and 3rd footnotes aren't.

Am I expecting the unreasonable or am I plain wrong?
If so, is there any workaround except typing HTML directly (which BTW is
what I'd like to avoid - and the reason to use RedCloth :) )?


# Ruby code start --------------------
require "redcloth"
rdcl = RedCloth.new( DATA.read )
puts rdcl.to_html
__END__
the answer is ... is ...
The answer is "42"[1]

A reference without quote before it[2]
Any _special_ chars like three dots in a row...[3]
some...
....more...
text...

fn1. Douglas Adams

fn2. ... yields the expected HTML

fn3. ... don't seem to to be 'footnotable' either
# Ruby code end --------------------


The output is:
---- out put starts here ----
<p>the answer is … is …<br />
The answer is “42”[1]</p>

<p>A reference without quote before it<sup><a href="#fn2">2</a></sup><br />
Any <em>special</em> chars like three dots in a row…[3]<br />
some…<br />
....more…<br />
text…</p>

<p id="fn1"><sup>1</sup> Douglas Adams</p>

<p id="fn2"><sup>2</sup> ... yields the expected <span
class="caps">HTML</span></p>

<p id="fn3"><sup>3</sup> ... don’t seem to to be
‘footnotable’ either<br />
---- out put ends here ----

Note, that '[1]' and '[3]' are not replaced while the '[2]' part is
rendered into '<sup><a href="#fn2">2</a></sup>'.

Ah well, the version information:
Ruby is
a) 1.8.1-13 on a WinXP (the 1-click-installer)
b) 1.8.2 preview2 (preview of the latest stable release)
running under Linux

In both cases the RedCloth version is 2.0.11.

Happy rubying

Stephan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top