Skip to content

Weird entity code in markdown footnotes #71

@Jaymon

Description

@Jaymon

In a test, if you create a page:

 p = self.get_page([
            "before",
            "",
            'footnote[^1]',
            "",
            "after",
            "",
            "[^1]: http://example.com foo",
        ])

And then get the html using p.html, you get this html:

    <p>before</p>
    <p>footnote<sup id="fnref-3-1"><a class="footnote-ref" href="#fn-3-1">1</a></sup></p>
    <p>after</p>
    <div class="footnote">
    <hr>
    <ol>
    <li id="fn-3-1">
    <p><a class="embed" href="http://example.com&#160">http://example.com&#160</a>;<a class="footnote-backref" href="#fnref-3-1" title="Jump back to footnote 1 in the text">&#8617;</a></p>
    </li>
    </ol>
    </div>

Notice the a tag:

<a class="embed" href="http://example.com&#160">http://example.com&#160</a>

The footnotes plugin is placing &#160 (which is the &nbsp; entity) on the footnote and then the linkify embed plugin is picking that up and putting it into the auto generated url, it's not the end of the world but it's weird it's doing that.

I've traced this back to the builtin markdown footnotes code (not Bang's code), but I don't know why it is putting &#160 at the end of the footnote.

The first thing I'm going to do is update to the latest version of markdown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions