Markdown With Footnotes

This page demonstrates the syntax for footnotes used in my extension to PHP-Markdown. To see the unprocessed version, visit index.text in this directory.

Footnotes[^1] are added in-text like so:

Footnotes[^1] are added in-text like so ...

And with a matching footnote definition at the end of the document:

[^1]: 
Footnotes are the mind killer.  
Footnotes are the little-death that brings total obliteration.  
I will face my footnotes.

Note the caret/circumflex/hat ("^"). As with reference-style links, the line-break after the colon is optional.

Footnote Contents

As with list items, any subsequent paragraphs inside a note should be indented[^2].

[^2]: This is the first paragraph.

    This paragraph is inside the note.
    It looks better if the whole paragraph
is indented, but it isn't required. The
first line is enough.

The first line of this paragraph is not
indented, so it is not part of the note.

Footnote definitions can, like reference-style links, be added in the middle of a document. There is no requirement that they stay at the end.

Footnotes can contain any markup [^3], either Markdown or HTML, including other footnote references. They cannot contain link or footnote definitions.

Inline Footnotes

For consistency with links, footnotes can be added inline ^4:

I met Jim [^jim](My old college roommate) at the station.

Inline notes will work even without the identifier:

I met Jim [^](My old college roommate) at the station.

Auto-numbering

As with links, it's up to you to keep the link identifiers unique. However, footnotes are auto-numbered, so you can use note names like [^bob] or [^apple][^apple] and still end up with a nice ordered list of numbers.[^numbers]

Footnotes are the mind killer.
Footnotes are the little-death that brings total obliteration.
I will face my footnotes.

[^2]: This is the first paragraph.

This paragraph is inside the note.
It looks better if the whole paragraph

is indented, but it isn't required. The first line is enough.

[^3]: This is a pointless example footnote containing a raw HTML table.

<table>
    <thead>
        <tr>
            <th>A</th>
            <th>B</th>
        <tr>
    </thead>
    <tbody>
        <tr>
            <td>1</td>
            <td>2</td>
        </tr>
    </tbody>
</table>

This footnote has the id "`^apple`" and contains a list in Markdown syntax.

* Apple
* Orange
* Hedgehog

[^numbers]: Since the numbering is done at run time, this will break link permanence if the document is edited. I don't consider that enough of a problem to worry about, but it's worth keeping in mind.