trentm / trentm/python-markdown2

Incorrect HTML when using footnotes and smarty-pants together

Open
#150 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.8k
Forks
459
Avg merge
2d 19h
Merged PRs (30d)
4

Description

    text = """
    foo[^1]

    [^1]: bar
    """
    markdown2.markdown(text, extras={'footnotes', 'smarty-pants'})

Results in

<p>foo<sup class="footnote-ref&#8221; id="fnref-1"><a href="#fn-1">1</a></sup></p>

<div class="footnotes">
<hr />
<ol>
<li id="fn-1">
<p>bar&nbsp;<a href="#fnref-1" class="footnoteBackLink" title="Jump back to footnote 1 in the text.">&#8617;</a></p>
</li>
</ol>
</div>

The quotation mark right before id in the footnote ref is incorrectly converted by smarty-pants to a right quotation mark glyph.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the markdown2.markdown entry point and reproduce the issue with the provided footnotes and smarty-pants example. Trace the generated footnote reference HTML; done means the class attribute remains valid and the quotation mark is not converted into a right-quotation glyph.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
content
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.