This is an example with ^broken superscript.
' expect(render_markdown(markdown)).to include(expected_output) end it 'does not convert text that only ends with ^' do markdown = 'This is an example with broken^ superscript.' expected_output = 'This is an example with broken^ superscript.
' expect(render_markdown(markdown)).to include(expected_output) end it 'does not convert text with uneven numbers of ^' do markdown = 'This is an example with ^broken^ superscript^.' expected_output = 'This is an example with broken superscript^.
' expect(render_markdown(markdown)).to include(expected_output) end end describe '#link' do def render_markdown_link(link) doc = CommonMarker.render_doc("[link](#{link})", :DEFAULT) renderer.render(doc) end context 'when link is a YouTube URL' do let(:youtube_url) { 'https://www.youtube.com/watch?v=VIDEO_ID' } it 'renders an iframe with YouTube embed code' do output = render_markdown_link(youtube_url) expect(output).to include('src="https://www.youtube-nocookie.com/embed/VIDEO_ID"') expect(output).to include('allowfullscreen') end end context 'when link is a Loom URL' do let(:loom_url) { 'https://www.loom.com/share/VIDEO_ID' } it 'renders an iframe with Loom embed code' do output = render_markdown_link(loom_url) expect(output).to include('src="https://www.loom.com/embed/VIDEO_ID"') expect(output).to include('webkitallowfullscreen mozallowfullscreen allowfullscreen') end end context 'when link is a Vimeo URL' do let(:vimeo_url) { 'https://vimeo.com/1234567' } it 'renders an iframe with Vimeo embed code' do output = render_markdown_link(vimeo_url) expect(output).to include('src="https://player.vimeo.com/video/1234567?dnt=true"') expect(output).to include('allowfullscreen') end end context 'when link is an MP4 URL' do let(:mp4_url) { 'https://example.com/video.mp4' } it 'renders a video element with the MP4 source' do output = render_markdown_link(mp4_url) expect(output).to include('