# frozen_string_literal: true require 'spec_helper' RSpec.describe Banzai::Filter::FootnoteFilter do include FilterSpecHelper # first[^1] and second[^second] # [^1]: one # [^second]: two let(:footnote) do <<~EOF

first1 and second2

same reference1

  1. one

  2. two

EOF end let(:filtered_footnote) do <<~EOF

first1 and second2

same reference1

  1. one

  2. two

EOF end context 'when footnotes exist' do let(:doc) { filter(footnote) } let(:link_node) { doc.css('sup > a').first } let(:identifier) { link_node[:id].delete_prefix('fnref1-') } it 'properly adds the necessary ids and classes' do expect(doc.to_html).to eq filtered_footnote end end end