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

This is a preamble

Introduction Introduction Subsection
Scope

Text

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2
Symbol
Definition
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a Normative References Bibliography Bibliography Subsection
INPUT #{HTML_HDR}

Foreword

This is a preamble


Introduction

Introduction Subsection

1.  Scope

Text

2.  Normative references

3.  Terms, definitions, symbols and abbreviated terms

3.1.  Normal Terms

3.1.1.

Term2

3.2.  Symbols and abbreviated terms

Symbol

Definition

4.  Symbols and abbreviated terms

Symbol

Definition

5.  Clause 4

5.1.  Introduction

5.2.  Clause 4.2


Annex A
(normative)

Annex

A.1.  Annex A.1

A.1.1.  Annex A.1a


Bibliography

Bibliography Subsection

OUTPUT end it "defaults to English" do expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT") tlh Foreword

This is a preamble

Introduction Introduction Subsection
Scope

Text

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2
Symbol
Definition
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a Normative References Bibliography Bibliography Subsection
INPUT #{HTML_HDR.gsub(/ lang="en">/, ' lang="tlh">')}

Foreword

This is a preamble


Introduction

Introduction Subsection

1.  Scope

Text

2.  Normative references

3.  Terms, definitions, symbols and abbreviated terms

3.1.  Normal Terms

3.1.1.

Term2

3.2.  Symbols and abbreviated terms

Symbol

Definition

4.  Symbols and abbreviated terms

Symbol

Definition

5.  Clause 4

5.1.  Introduction

5.2.  Clause 4.2


Annex A
(normative)

Annex

A.1.  Annex A.1

A.1.1.  Annex A.1a


Bibliography

Bibliography Subsection

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

This is a preamble

Introduction Introduction Subsection
Scope

Text

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2
Symbol
Definition
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a Normative References Bibliography Bibliography Subsection
INPUT #{HTML_HDR.gsub(/ lang="en">/, ' lang="fr">')}

Avant-propos

This is a preamble


Introduction

Introduction Subsection

1.  Domaine d'application

Text

2.  Références normatives

3.  Terms, définitions, symboles et termes abrégés

3.1.  Normal Terms

3.1.1.

Term2

3.2.  Symboles et termes abrégés

Symbol

Definition

4.  Symboles et termes abrégés

Symbol

Definition

5.  Clause 4

5.1.  Introduction

5.2.  Clause 4.2


Annexe A
(normative)

Annex

A.1.  Annex A.1

A.1.1.  Annex A.1a


Bibliographie

Bibliography Subsection

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

This is a preamble

Introduction Introduction Subsection
Scope

11

Terms, Definitions, Symbols and Abbreviated Terms Normal Terms Term2
Symbol
Definition
Symbol
Definition
Clause 4 Introduction Clause 4.2
Annex Annex A.1 Annex A.1a Normative References Cereals and cereal products ISO 712 ISO Bibliography Bibliography Subsection
INPUT #{HTML_HDR.gsub(/ lang="en">/, ' lang="zh">')}

前言

This is a preamble


引言

Introduction Subsection

1.  范围

ISO 712、第1–1

2.  规范性引用文件

ISO 712, Cereals and cereal products

3.  术语、定义、符号、代号和缩略语

3.1.  Normal Terms

3.1.1.

Term2

3.2.  符号、代号和缩略语

Symbol

Definition

4.  符号、代号和缩略语

Symbol

Definition

5.  Clause 4

5.1.  Introduction

5.2.  Clause 4.2


附件A
(规范性附录)

Annex

A.1.  Annex A.1

A.1.1.  Annex A.1a


参考文献

Bibliography Subsection

OUTPUT end end