PHPackages                             philippoehrlein/inline-footnotes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. philippoehrlein/inline-footnotes

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

philippoehrlein/inline-footnotes
================================

A CommonMark extension to support inline footnotes in the format \[^Text of the footnote\]

1.0.1(1y ago)05MITPHPPHP ^7.4 || ^8.0

Since Apr 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/philippoehrlein/inlineFootnotes)[ Packagist](https://packagist.org/packages/philippoehrlein/inline-footnotes)[ Docs](https://github.com/philippoehrlein/inline-footnotes)[ RSS](/packages/philippoehrlein-inline-footnotes/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

[![Cover Inline Footnotes](.github/cover-inline-footnotes.png)](.github/cover-inline-footnotes.png)

Inline Footnotes for CommonMark
===============================

[](#inline-footnotes-for-commonmark)

[![Version](https://camo.githubusercontent.com/a89e7b105ed96f5df779c957a407096e8ba56f262655c3fdbcfec50cf634dd47/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e312d626c75652e737667)](https://packagist.org/packages/philippoehrlein/inline-footnotes)

This PHP library extends the [League/CommonMark](https://github.com/thephpleague/commonmark) parser to support inline footnotes in the format `[^Footnote text]`. Unlike the reference-style footnote format commonly used in various [Markdown](https://daringfireball.net/projects/markdown/) implementations, this format allows you to enter the footnote text directly at the point where it's needed.

How It Works
------------

[](#how-it-works)

This extension doesn't handle the rendering of footnotes itself. Instead, it works as a preprocessor that:

1. Detects inline footnotes in the format `[^Footnote text]`
2. Converts them to standard reference-style footnotes before passing the content to the CommonMark parser
3. Relies on the standard `FootnoteExtension` for actual rendering

Therefore, you need to use both extensions together.

Installation
------------

[](#installation)

Install the library via Composer:

```
composer require philippoehrlein/inline-footnotes
```

Usage
-----

[](#usage)

```
