require "spec_helper" require "nokogiri" RSpec.describe IsoDoc do it "cleans up admonitions" do expect(IsoDoc::WordConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT"
Warning

Text

INPUT

Warning—Text

OUTPUT end it "cleans up figures" do expect(IsoDoc::HtmlConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT"

Warning

a
INPUT

Warning

a 

Parboiled rice.

OUTPUT end it "cleans up figures (Word)" do expect(IsoDoc::WordConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT"

Warning

a
INPUT

Warning

a 

Parboiled rice.

OUTPUT end it "cleans up inline headers" do expect(IsoDoc::WordConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT" test

 


 


4.  Clause 4

4.1. Introduction

4.2. Clause 4.2
4.3. Clause 4.3

text

INPUT test

 


 


4.  Clause 4

4.1. Introduction

4.2. Clause 4.2

4.3. Clause 4.3 text

OUTPUT end it "cleans up footnotes" do expect(IsoDoc::HtmlConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT" test

 



Foreword

A.2

B.2

C.1

 


INPUT test

 



Foreword

A.1

B.2

C.3

 


OUTPUT end it "cleans up tables with tfoot" do expect(IsoDoc::HtmlConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT" test

 



Foreword

Table 1 — Repeatability and reproducibility of husked rice yield

Drago

A type of rice

NOTE  This is a table about rice

Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, (#(R)#) (= 2,83 (#(s_R)#)) 2,89 0,57 2,26 6,06

 


INPUT test

 



Foreword

Table 1 — Repeatability and reproducibility of husked rice yield

Drago

A type of rice
Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, (#(R)#) (= 2,83 (#(s_R)#)) 2,89 0,57 2,26 6,06

NOTE  This is a table about rice

a  Parboiled rice.

 


OUTPUT end it "cleans up tables with tfoot (Word)" do expect(IsoDoc::WordConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT" test

 



Foreword

Table 1 — Repeatability and reproducibility of husked rice yield

Drago

A type of rice

NOTE  This is a table about rice

Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, (#(R)#) (= 2,83 (#(s_R)#)) 2,89 0,57 2,26 6,06

 


INPUT test

 



Foreword

Table 1 — Repeatability and reproducibility of husked rice yield

Drago

A type of rice
Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7
Reproducibility limit, (#(R)#) (= 2,83 (#(s_R)#)) 2,89 0,57 2,26 6,06

NOTE  This is a table about rice

a  Parboiled rice.

 


OUTPUT end it "cleans up tables without tfoot" do expect(IsoDoc::HtmlConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT" test

 



Foreword

Table 1 — Repeatability and reproducibility of husked rice yield

Drago

A type of rice

NOTE  This is a table about rice

Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7

 


INPUT test

 



Foreword

Table 1 — Repeatability and reproducibility of husked rice yield

Drago

A type of rice
Description Rice sample
Arborio Dragoa Balillaa Thaibonnet
Number of laboratories retained after eliminating outliers 13 11 13 13
Mean value, g/100 g 81,2 82,0 81,8 77,7

NOTE  This is a table about rice

a  Parboiled rice.

 


OUTPUT end it "cleans up symbols lists" do expect(IsoDoc::WordConvert.new({}).cleanup(Nokogiri::XML(<<~"INPUT")).to_s).to be_equivalent_to <<~"OUTPUT"

4.  Symbols and Abbreviated Terms

(#(α)#)

Definition 1

(#(xa)#)

Definition 2

(#(x_1)#)

Definition 3

(#(x_m)#)

Definition 4

(#(x)#)

Definition 5
INPUT

4.  Symbols and Abbreviated Terms

(#(x)#)

Definition 5

(#(x_m)#)

Definition 4

(#(x_1)#)

Definition 3

(#(xa)#)

Definition 2

(#(α)#)

Definition 1
OUTPUT end end