require "spec_helper" RSpec.describe Asciidoctor::BSI do before(:all) do @blank_hdr = blank_hdr_gen end it "processes inline_quoted formatting" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} _emphasis_ *strong* `monospace` "double quote" 'single quote' super^script^ sub~script~ stem:[a_90] stem:[ F Α ] [alt]#alt# [deprecated]#deprecated# [domain]#domain# [strike]#strike# [smallcap]#smallcap# INPUT #{@blank_hdr} emphasis strong monospace “double quote” ‘single quote’ superscript subscript a 90 F Α alt deprecated domain strike smallcap OUTPUT end it "processes breaks" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} Line break + line break ''' <<< INPUT #{@blank_hdr}

Line break
line break


OUTPUT end it "processes links" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} mailto:fred@example.com http://example.com[] http://example.com[Link] INPUT #{@blank_hdr}

mailto:fred@example.com Link

OUTPUT end it "processes bookmarks" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} Text [[bookmark]] Text INPUT #{@blank_hdr}

Text Text

OUTPUT end it "processes crossreferences" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [[reference]] == Section Inline Reference to <> Footnoted Reference to <> Inline Reference with Text to <> Footnoted Reference with Text to <> INPUT #{@blank_hdr} Section

Inline Reference to Footnoted Reference to Inline Reference with Text to text Footnoted Reference with Text to text

OUTPUT end it "processes bibliographic anchors" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[ISO712,x]]] Reference * [[[ISO713]]] Reference INPUT #{@blank_hdr} Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes provisions of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

Reference [N1] x Reference [N2] ISO713 713
OUTPUT end it "processes footnotes" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :bsi, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} Hello!footnote:[Footnote text] INPUT #{@blank_hdr}

Hello!

Footnote text

OUTPUT end end