require "spec_helper" RSpec.describe IsoDoc do it "processes inline formatting" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

A B C D E F G


INPUT #{HTML_HDR}

Foreword

A B C D E F G



OUTPUT end it "processes links" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

example mailto:fred@example.com

INPUT #{HTML_HDR}

Foreword

http://example.com example fred@example.com mailto:fred@example.com

OUTPUT end it "processes unrecognised markup" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

example

INPUT #{HTML_HDR}

Foreword

<barry fred="http://example.com">example</barry>

OUTPUT end it "processes AsciiMath and MathML" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

A X Latex?

INPUT #{HTML_HDR}

Foreword

(#(A)#) X Latex?

OUTPUT end it "overrides AsciiMath delimiters" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

A (#((Hello))#)

INPUT #{HTML_HDR}

Foreword

(#(((A)#))) (#((Hello))#)

OUTPUT end it "processes eref types" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

A A

Normative References Cereals and cereal products ISO 712 ISO INPUT #{HTML_HDR}

Foreword

A A

1.  Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements 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.

ISO 712, Cereals and cereal products

OUTPUT end it "processes eref content" do expect(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"

1 11 11 1 1.5 1A 7 A

Normative References Cereals and cereal products ISO 712 ISO
INPUT #{HTML_HDR}

Foreword

ISO 712 ISO 712 ISO 712, Table 1 ISO 712, Table 1–1 ISO 712, Clause 1, Table 1 ISO 712, Clause 1 ISO 712, 1.5 A ISO 712, ISO 712, Prelude 7 A

1.  Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements 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.

ISO 712, Cereals and cereal products

OUTPUT end end