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

A.

Formerly denoted as 15 % (m/m).

B.

Formerly denoted as 15 % (m/m).

C.

Hello! denoted as 15 % (m/m).

INPUT #{HTML_HDR}

Foreword

A. 2

B. 2

C. 1

OUTPUT end it "processes IsoXML footnotes (Word)" do expect(xmlpp(IsoDoc::WordConvert.new({}).convert("test", <<~"INPUT", true).gsub(/_Ref\d+/, "_Ref"))).to be_equivalent_to xmlpp(<<~"OUTPUT")

A.

Formerly denoted as 15 % (m/m).

B.

Formerly denoted as 15 % (m/m).

C.

Hello! denoted as 15 % (m/m).

INPUT

 



Foreword

A. 2

B. NOTEREF _Ref \\f \\h 2

C. 1

 


OUTPUT end it "processes IsoXML reviewer notes (HTML)" do FileUtils.rm_f "test.html" IsoDoc::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)

A.

B.

A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.

For further information on the Foreword, see ISO/IEC Directives, Part 2, 2016, Clause 12.

C.

Second note.

Second note.

INPUT html = File.read("test.html").sub(/^.*.*$}m, "") expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")

 


 



Foreword

A.

B.

C.


Introduction

OUTPUT end it "processes IsoXML reviewer notes (Word)" do FileUtils.rm_f "test.doc" IsoDoc::WordConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)

A.

B.

A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.

For further information on the Foreword, see ISO/IEC Directives, Part 2, 2016, Clause 12.

C.

Second note.

Second note.

INPUT html = File.read("test.doc").sub(/^.*.*$}m, "") expect(xmlpp(html)).to be_equivalent_to xmlpp(<<~"OUTPUT")

 



Foreword

A.

B.

C.


Introduction

 


Second note.

A Foreword shall appear in each document. The generic text is shown here. It does not contain requirements, recommendations or permissions.

For further information on the Foreword, see ISO/IEC Directives, Part 2, 2016, Clause 12.

Second note.

OUTPUT end end