Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The footnotes extension does not work when the superscript extension is enabled #217

Closed
DannyBen opened this issue Jan 16, 2023 · 1 comment

Comments

@DannyBen
Copy link
Contributor

DannyBen commented Jan 16, 2023

Description

Enabling both the footnotes and the superscript extensions causes the footnotes extension to stop working.

Environment

  • Commonmarker version 1.0.0.pre6
  • Ruby 3.1.3
  • Ubuntu 20.4

Reproduction code

require 'bundler/inline'
gemfile { gem 'commonmarker', '1.0.0.pre6' }

markdown = <<~MARKDOWN
  Gimme footnote[^1]
  This is ^superscript^

  [^1]: Here is the footnote
MARKDOWN

extensions = { footnotes: true, superscript: true }
options = { extension: extensions, render: { hardbreaks: false } }
output = Commonmarker.to_html markdown, options: options
puts output

Actual output

<p>
  Gimme footnote[^1]
  This is <sup>superscript</sup>
</p>

Expected output

(which can be observed by disabling the superscript extension in the code above)

<p>
  Gimme footnote<sup class="footnote-ref"><a href="#fn1" id="fnref1">1</a></sup>
  This is <sup>superscript</sup>
</p>
<section class="footnotes">
  <ol>
    <li id="fn1">
      <p>Here is the footnote <a href="#fnref1" class="footnote-backref"></a></p>
    </li>
  </ol>
</section>

code was prettified manually, for clarity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants