test/markdown-test3.md

Markdown Footnotes Test Document

This document should help with testing of footnotes support that is introduced by the "markdown-footnotes" branch. It might look pretty misformatted unless rendered by the proper Fossil executable that incorporates the abovementioned branch.[^1]
That is also a humble attempt to explore the robustness of the Markdown parser. So please excuse for the mess in the source code of this document. By no means the normal use of footnotes should look that scarry.

Developers are invited to add test cases here7. It is suggested that the more simple is a test case the earlier it should appear in this document.[^ if glitch occurs ]

A footnote's label should be case insensitive[^ case INSENSITIVE ], it is whitespace-savvy and can even contain newlines.[^ a multiline label]

A labeled footnote may be [referenced several times]11.

A footnote's text should support Markdown [markup][^].
Markup within [a text fragment of a span-bounded footnote]13 should also be rendered.

Another reference11 to the preveously used footnote.

Default skin renders label in red font and the main text in gray. Other styling may also apply.

Inline footnotes are supported.(^These may be usefull for adding small comments.)

This is a corner case that is rendered as an empty footnote.

If [undefined label is used][^] then red "misref" is emited instead of a numeric marker.[^ see it yourself ] This can be overridden by the skin though.

The refenrence at the end of this sentence is the sole reason of rendering of lost1 and [lost2][^].

If several labeled footnote definitions have the same equal label then texts from all these definitions are joined.2

Several references should be recognized as several distinct numbers. (^There should be an interval between numbers.) 11

If markup is ambigous between a span-bounded footnote and a "free-standing" footnote followed by another footnote then interpret as the later case. This facilitates the usage in the usual case when several footnotes are refenrenced at the end of a phrase.1711(^All these four should be parsed as "free-standing" footnotes)[^Coelurosauria]

An ambiguity between a link to an image and a free-standing referenced footnote should be resolved as a footnote!15

A footnote may not be empty(^) or consist just of blank characters.(^
)

The same holds for labeled footnotes. If definition of a labeled footnote is blank then it is not accepted by the first pass of the parser and is recognized during the second pass as misreference.

It is possible to provide a list of classes for a particular footnote and all its references. This is achieved by prepending a footnote's text with a special token that starts with dot and ends with colon. (^ .alpha-Numeric123.EXAMPLE: This token defines a dot-separated list of CSS classes which are added to that particular footnote and also to the corresponding reference(s). Hypens ('-') are also allowed. Classes from the token are tranformed to lowercase and are prepended with "fn-upc-" to avoid collisions. )
This feature is "opt-in": there is nothing wrong in starting a footnote's text with a token of that form while not defining any corresponding classes in the stylesheet.21 If a footnote consists just of a valid userclass token then this token is not interpreted as such, instead it is emitted as plain text. (^
.bare.classlist.inside.inline.footnote:
)18 19

Click here and here to test escaping of REQUEST_URI in the generated footnote markers.

A depth of nesting must be limited. (^ .L.1: A long chain of nested inline footnotes... (^ .L.2: is a rather unusual thing... (^ .L.3: and requires extra CPU cycles for processing. (^ .L.4: Theoretically speaking O(n2). (^ .L.5: Thus it is worth dismissing those footnotes... (^ .L.6: that are nested deeper than on a certain level. (^ .L.7: A particular value for that limit... (^ is hard-coded in src/markdown.c ... (^ in function markdown() ... (^ in variable named maxDepth. (^ For the time being, its value is 5 ) ) ) ) ) ) ) ) ) ) )

Footnotes

(^This is inline note defined inside of [a labeled note]12.)


  1. This note was defined at the begining of the document. 

  2. And that came from the end of the document. 

  3. This note was defined in the middle of the document. It references [its previous]1 and [the forthcoming]12 siblings. 

  4. This should be presented verbatim (without any [markup][^]) in the end of the footnotes. 

  5. Footnotes is a Fossil extension of Markdown. Your other tools may have limited support for these. 

  6. History of test/markdown-test3.md 

  7. So that simple cases are processed even if
    a glitch happens for more tricky cases.
    

  8. And also tolerate whitespaces. 

  9. But at a footnote's definition it should still be written within square brackets on a single line. 

  10. Each letter on the left is a back-reference to the place of use. Highlighted back-reference indicates a place from which navigation occurred12

  11. This note was defined at the end of the document. It defines an inline note. 

  12. E.g. emphasis, and so on. BTW, this note may not have a backreference to the "stray". 

  13. For example due to a typo. 

  14. The rationale is that URLs do not start with ^ while a footnote may follow immediately after an exclamation mark at the end of a sentence. 

  15. Just to verify the correctness of ordering and styling. 

  16. Which is common in the scientific publications. 

  17. .at.the.1st.line.of.labeled.footnote.definition: 

  18.    .at.the.2nd.line.of.labeled.footnote.definition:
    

  19. .UPC-token: A token of user-provided classes must be rendered within strays. Aslo: this and the previous line may not have extra indentation. 

  20. .unused.classes: In that case text of the footnote just looks like as if no special processing occured. 

  21. Labels are escaped 

  22. Content is also escaped  

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button