Skip to content

Multiline footnotes support is broken #2595

@njor

Description

@njor

Problem

Footnotes with multiple paragraphs are rendered incorrectly, where all the line breaks that should be between paragraphs are ignored, and all the content of the footnote is just concatenated together.

Steps

The following markdown should generate a multiline footnote :

    A paragraph with a footnote[^fn1] inside.
    
    [^fn1]: First paragraph of the footnote.
    
        Second paragraph of the footnote.

Expected result : something like that :
Image

Actual result :
Image

Notes

It looks like the problem is not in the generated HTML, which correctly contains the <p> elements, but in general.css, in the following rule :

.footnote-definition p {
    display: inline;
}

Possible Solution(s)

Replacing this CSS rule with something like this solves the problem:

.footnote-definition {
    margin-left: 1em;
    position: relative;
}

.footnote-definition-label {
    position: absolute;
    margin-right: 0.5em;
    right: 100%;
}

Version

mdbook v0.4.43

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-StyleArea: Style (CSS, etc.)A-footnotesArea: footnotesC-bugCategory: A bug, incorrect or unintended behaviorE-Help-wantedExperience: Help Needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions