metanorma-iso 1.6.1 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +11 -41
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/iso/base.rb +13 -13
- data/lib/asciidoctor/iso/basicdoc.rng +5 -3
- data/lib/asciidoctor/iso/biblio.rng +4 -6
- data/lib/asciidoctor/iso/cleanup.rb +1 -1
- data/lib/asciidoctor/iso/front.rb +6 -6
- data/lib/asciidoctor/iso/front_id.rb +30 -25
- data/lib/asciidoctor/iso/isodoc.rng +108 -2
- data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
- data/lib/asciidoctor/iso/isostandard.rng +17 -97
- data/lib/asciidoctor/iso/validate.rb +68 -1
- data/lib/asciidoctor/iso/validate_title.rb +21 -13
- data/lib/isodoc/iso/base_convert.rb +11 -0
- data/lib/isodoc/iso/html/header.html +12 -12
- data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
- data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
- data/lib/isodoc/iso/html_convert.rb +2 -2
- data/lib/isodoc/iso/i18n-en.yaml +6 -0
- data/lib/isodoc/iso/i18n-fr.yaml +4 -0
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +4 -0
- data/lib/isodoc/iso/index.rb +140 -0
- data/lib/isodoc/iso/iso.amendment.xsl +1009 -321
- data/lib/isodoc/iso/iso.international-standard.xsl +1009 -321
- data/lib/isodoc/iso/presentation_xml_convert.rb +1 -4
- data/lib/isodoc/iso/word_convert.rb +2 -2
- data/lib/isodoc/iso/xref.rb +5 -0
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +4 -4
- data/spec/asciidoctor/amd_spec.rb +696 -0
- data/spec/asciidoctor/base_spec.rb +704 -0
- data/spec/asciidoctor/blocks_spec.rb +527 -0
- data/spec/asciidoctor/cleanup_spec.rb +1134 -0
- data/spec/asciidoctor/inline_spec.rb +195 -0
- data/spec/asciidoctor/lists_spec.rb +197 -0
- data/spec/asciidoctor/refs_spec.rb +375 -0
- data/spec/asciidoctor/section_spec.rb +393 -0
- data/spec/asciidoctor/table_spec.rb +329 -0
- data/spec/asciidoctor/validate_spec.rb +1572 -0
- data/spec/isodoc/amd_spec.rb +967 -946
- data/spec/isodoc/blocks_spec.rb +530 -507
- data/spec/isodoc/i18n_spec.rb +953 -911
- data/spec/isodoc/inline_spec.rb +355 -293
- data/spec/isodoc/iso_spec.rb +340 -316
- data/spec/isodoc/metadata_spec.rb +392 -382
- data/spec/isodoc/postproc_spec.rb +834 -656
- data/spec/isodoc/ref_spec.rb +374 -331
- data/spec/isodoc/section_spec.rb +821 -519
- data/spec/isodoc/table_spec.rb +472 -411
- data/spec/isodoc/terms_spec.rb +209 -185
- data/spec/isodoc/xref_spec.rb +1370 -1236
- data/spec/metanorma/processor_spec.rb +28 -26
- data/spec/spec_helper.rb +186 -189
- metadata +26 -27
- data/.rubocop.ribose.yml +0 -66
- data/spec/asciidoctor-iso/amd_spec.rb +0 -694
- data/spec/asciidoctor-iso/base_spec.rb +0 -713
- data/spec/asciidoctor-iso/blocks_spec.rb +0 -482
- data/spec/asciidoctor-iso/cleanup_spec.rb +0 -1025
- data/spec/asciidoctor-iso/inline_spec.rb +0 -170
- data/spec/asciidoctor-iso/lists_spec.rb +0 -190
- data/spec/asciidoctor-iso/refs_spec.rb +0 -317
- data/spec/asciidoctor-iso/section_spec.rb +0 -362
- data/spec/asciidoctor-iso/table_spec.rb +0 -313
- data/spec/asciidoctor-iso/validate_spec.rb +0 -1550
- data/spec/assets/xref_error.adoc +0 -7
    
        data/spec/isodoc/inline_spec.rb
    CHANGED
    
    | @@ -2,330 +2,392 @@ require "spec_helper" | |
| 2 2 |  | 
| 3 3 | 
             
            RSpec.describe IsoDoc do
         | 
| 4 4 | 
             
              it "processes inline formatting" do
         | 
| 5 | 
            -
                 | 
| 6 | 
            -
             | 
| 7 | 
            -
             | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 10 | 
            -
             | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
             | 
| 5 | 
            +
                output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 6 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 7 | 
            +
                    <preface>
         | 
| 8 | 
            +
                      <foreword>
         | 
| 9 | 
            +
                        <p>
         | 
| 10 | 
            +
                          <em>A</em>
         | 
| 11 | 
            +
                          <strong>B</strong>
         | 
| 12 | 
            +
                          <sup>C</sup>
         | 
| 13 | 
            +
                          <sub>D</sub>
         | 
| 14 | 
            +
                          <tt>E</tt>
         | 
| 15 | 
            +
                          <strike>F</strike>
         | 
| 16 | 
            +
                          <smallcap>G</smallcap>
         | 
| 17 | 
            +
                          <br/>
         | 
| 18 | 
            +
                          <hr/>
         | 
| 19 | 
            +
                          <bookmark id="H"/>
         | 
| 20 | 
            +
                          <pagebreak/>
         | 
| 21 | 
            +
                        </p>
         | 
| 22 | 
            +
                      </foreword>
         | 
| 23 | 
            +
                    </preface>
         | 
| 24 | 
            +
                    <sections>
         | 
| 25 | 
            +
                  </iso-standard>
         | 
| 16 26 | 
             
                INPUT
         | 
| 17 | 
            -
                 | 
| 18 | 
            -
             | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 22 | 
            -
             | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 27 | 
            +
                expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 28 | 
            +
                  #{HTML_HDR}
         | 
| 29 | 
            +
                        <br/>
         | 
| 30 | 
            +
                        <div>
         | 
| 31 | 
            +
                          <h1 class="ForewordTitle">Foreword</h1>
         | 
| 32 | 
            +
                          <p>
         | 
| 33 | 
            +
                            <i>A</i>
         | 
| 34 | 
            +
                            <b>B</b>
         | 
| 35 | 
            +
                            <sup>C</sup>
         | 
| 36 | 
            +
                            <sub>D</sub>
         | 
| 37 | 
            +
                            <tt>E</tt>
         | 
| 38 | 
            +
                            <s>F</s>
         | 
| 39 | 
            +
                            <span style="font-variant:small-caps;">G</span>
         | 
| 40 | 
            +
                            <br/>
         | 
| 41 | 
            +
                            <hr/>
         | 
| 42 | 
            +
                            <a id="H"/>
         | 
| 43 | 
            +
                            <br/>
         | 
| 44 | 
            +
                          </p>
         | 
| 45 | 
            +
                        </div>
         | 
| 46 | 
            +
                        <p class="zzSTDTitle1"/>
         | 
| 47 | 
            +
                      </div>
         | 
| 48 | 
            +
                    </body>
         | 
| 49 | 
            +
                  </html>
         | 
| 31 50 | 
             
                OUTPUT
         | 
| 32 51 | 
             
              end
         | 
| 33 52 |  | 
| 34 53 | 
             
              it "processes links" do
         | 
| 35 | 
            -
                 | 
| 36 | 
            -
             | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
             | 
| 40 | 
            -
             | 
| 41 | 
            -
             | 
| 42 | 
            -
             | 
| 43 | 
            -
             | 
| 44 | 
            -
             | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 54 | 
            +
                output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 55 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 56 | 
            +
                    <preface>
         | 
| 57 | 
            +
                      <foreword>
         | 
| 58 | 
            +
                        <p>
         | 
| 59 | 
            +
                          <link target="http://example.com"/>
         | 
| 60 | 
            +
                          <link target="http://example.com">example</link>
         | 
| 61 | 
            +
                          <link target="mailto:fred@example.com"/>
         | 
| 62 | 
            +
                          <link target="mailto:fred@example.com">mailto:fred@example.com</link>
         | 
| 63 | 
            +
                        </p>
         | 
| 64 | 
            +
                      </foreword>
         | 
| 65 | 
            +
                    </preface>
         | 
| 66 | 
            +
                    <sections>
         | 
| 67 | 
            +
                  </iso-standard>
         | 
| 47 68 | 
             
                INPUT
         | 
| 48 | 
            -
                 | 
| 49 | 
            -
             | 
| 50 | 
            -
             | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
             | 
| 54 | 
            -
             | 
| 55 | 
            -
             | 
| 56 | 
            -
             | 
| 57 | 
            -
             | 
| 58 | 
            -
             | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 61 | 
            -
             | 
| 62 | 
            -
             | 
| 69 | 
            +
                expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 70 | 
            +
                  #{HTML_HDR}
         | 
| 71 | 
            +
                        <br/>
         | 
| 72 | 
            +
                        <div>
         | 
| 73 | 
            +
                          <h1 class="ForewordTitle">Foreword</h1>
         | 
| 74 | 
            +
                          <p>
         | 
| 75 | 
            +
                            <a href="http://example.com">http://example.com</a>
         | 
| 76 | 
            +
                            <a href="http://example.com">example</a>
         | 
| 77 | 
            +
                            <a href="mailto:fred@example.com">fred@example.com</a>
         | 
| 78 | 
            +
                            <a href="mailto:fred@example.com">mailto:fred@example.com</a>
         | 
| 79 | 
            +
                          </p>
         | 
| 80 | 
            +
                        </div>
         | 
| 81 | 
            +
                        <p class="zzSTDTitle1"/>
         | 
| 82 | 
            +
                      </div>
         | 
| 83 | 
            +
                    </body>
         | 
| 84 | 
            +
                  </html>
         | 
| 63 85 | 
             
                OUTPUT
         | 
| 64 86 | 
             
              end
         | 
| 65 87 |  | 
| 66 88 | 
             
              it "processes unrecognised markup" do
         | 
| 67 | 
            -
                 | 
| 68 | 
            -
             | 
| 69 | 
            -
             | 
| 70 | 
            -
             | 
| 71 | 
            -
             | 
| 72 | 
            -
             | 
| 73 | 
            -
             | 
| 74 | 
            -
             | 
| 75 | 
            -
             | 
| 89 | 
            +
                output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 90 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 91 | 
            +
                    <preface>
         | 
| 92 | 
            +
                      <foreword>
         | 
| 93 | 
            +
                        <p>
         | 
| 94 | 
            +
                          <barry fred="http://example.com">example</barry>
         | 
| 95 | 
            +
                        </p>
         | 
| 96 | 
            +
                      </foreword>
         | 
| 97 | 
            +
                    </preface>
         | 
| 98 | 
            +
                    <sections>
         | 
| 99 | 
            +
                  </iso-standard>
         | 
| 76 100 | 
             
                INPUT
         | 
| 77 | 
            -
                 | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
             | 
| 82 | 
            -
             | 
| 83 | 
            -
             | 
| 84 | 
            -
             | 
| 85 | 
            -
             | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 88 | 
            -
             | 
| 101 | 
            +
                expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 102 | 
            +
                  #{HTML_HDR}
         | 
| 103 | 
            +
                        <br/>
         | 
| 104 | 
            +
                        <div>
         | 
| 105 | 
            +
                          <h1 class="ForewordTitle">Foreword</h1>
         | 
| 106 | 
            +
                          <p>
         | 
| 107 | 
            +
                            <para>
         | 
| 108 | 
            +
                              <b role="strong"><barry fred="http://example.com">example</barry></b>
         | 
| 109 | 
            +
                            </para>
         | 
| 110 | 
            +
                          </p>
         | 
| 111 | 
            +
                        </div>
         | 
| 112 | 
            +
                        <p class="zzSTDTitle1"/>
         | 
| 113 | 
            +
                      </div>
         | 
| 114 | 
            +
                    </body>
         | 
| 115 | 
            +
                  </html>
         | 
| 89 116 | 
             
                OUTPUT
         | 
| 90 117 | 
             
              end
         | 
| 91 118 |  | 
| 92 119 | 
             
              it "processes AsciiMath and MathML" do
         | 
| 93 | 
            -
                 | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
             | 
| 98 | 
            -
             | 
| 99 | 
            -
             | 
| 100 | 
            -
             | 
| 101 | 
            -
             | 
| 102 | 
            -
             | 
| 103 | 
            -
             | 
| 120 | 
            +
                output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 121 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 122 | 
            +
                    <preface>
         | 
| 123 | 
            +
                      <foreword>
         | 
| 124 | 
            +
                        <p>
         | 
| 125 | 
            +
                          <stem type="AsciiMath">A</stem>
         | 
| 126 | 
            +
                          <stem type="MathML"><m:math><m:row>X</m:row></m:math></stem>
         | 
| 127 | 
            +
                          <stem type="None">Latex?</stem>
         | 
| 128 | 
            +
                        </p>
         | 
| 129 | 
            +
                      </foreword>
         | 
| 130 | 
            +
                    </preface>
         | 
| 131 | 
            +
                    <sections>
         | 
| 132 | 
            +
                  </iso-standard>
         | 
| 104 133 | 
             
                INPUT
         | 
| 105 | 
            -
                 | 
| 106 | 
            -
             | 
| 107 | 
            -
             | 
| 108 | 
            -
             | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 111 | 
            -
             | 
| 112 | 
            -
             | 
| 113 | 
            -
             | 
| 114 | 
            -
             | 
| 115 | 
            -
             | 
| 116 | 
            -
             | 
| 117 | 
            -
             | 
| 118 | 
            -
             | 
| 119 | 
            -
             | 
| 120 | 
            -
             | 
| 134 | 
            +
                expect(xmlpp(output.sub(/<html/, "<html xmlns:m='m'"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 135 | 
            +
                  #{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
         | 
| 136 | 
            +
                        <br/>
         | 
| 137 | 
            +
                        <div>
         | 
| 138 | 
            +
                          <h1 class="ForewordTitle">Foreword</h1>
         | 
| 139 | 
            +
                          <p>
         | 
| 140 | 
            +
                            <span class="stem">(#(A)#)</span>
         | 
| 141 | 
            +
                            <span class="stem">
         | 
| 142 | 
            +
                              <m:math>
         | 
| 143 | 
            +
                                <m:row>X</m:row>
         | 
| 144 | 
            +
                              </m:math>
         | 
| 145 | 
            +
                            </span>
         | 
| 146 | 
            +
                            <span class="stem">Latex?</span>
         | 
| 147 | 
            +
                          </p>
         | 
| 148 | 
            +
                        </div>
         | 
| 149 | 
            +
                        <p class="zzSTDTitle1"/>
         | 
| 150 | 
            +
                      </div>
         | 
| 151 | 
            +
                    </body>
         | 
| 152 | 
            +
                  </html>
         | 
| 121 153 | 
             
                OUTPUT
         | 
| 122 154 | 
             
              end
         | 
| 123 155 |  | 
| 124 156 | 
             
              it "overrides AsciiMath delimiters" do
         | 
| 125 | 
            -
                 | 
| 126 | 
            -
             | 
| 127 | 
            -
             | 
| 128 | 
            -
             | 
| 129 | 
            -
             | 
| 130 | 
            -
             | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 133 | 
            -
             | 
| 134 | 
            -
                </iso-standard>
         | 
| 157 | 
            +
                output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 158 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 159 | 
            +
                    <preface>
         | 
| 160 | 
            +
                      <foreword>
         | 
| 161 | 
            +
                        <p><stem type="AsciiMath">A</stem>(#((Hello))#)</p>
         | 
| 162 | 
            +
                      </foreword>
         | 
| 163 | 
            +
                    </preface>
         | 
| 164 | 
            +
                    <sections>
         | 
| 165 | 
            +
                  </iso-standard>
         | 
| 135 166 | 
             
                INPUT
         | 
| 136 | 
            -
                 | 
| 137 | 
            -
             | 
| 138 | 
            -
             | 
| 139 | 
            -
             | 
| 140 | 
            -
             | 
| 141 | 
            -
             | 
| 142 | 
            -
             | 
| 143 | 
            -
             | 
| 144 | 
            -
             | 
| 145 | 
            -
             | 
| 146 | 
            -
             | 
| 147 | 
            -
             | 
| 148 | 
            -
             | 
| 167 | 
            +
                expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 168 | 
            +
                  #{HTML_HDR}
         | 
| 169 | 
            +
                          <br/>
         | 
| 170 | 
            +
                          <div>
         | 
| 171 | 
            +
                            <h1 class="ForewordTitle">Foreword</h1>
         | 
| 172 | 
            +
                          <p>
         | 
| 173 | 
            +
                            <span class="stem">(#(((A)#)))</span>
         | 
| 174 | 
            +
                            (#((Hello))#)
         | 
| 175 | 
            +
                          </p>
         | 
| 176 | 
            +
                        </div>
         | 
| 177 | 
            +
                        <p class="zzSTDTitle1"/>
         | 
| 178 | 
            +
                      </div>
         | 
| 179 | 
            +
                    </body>
         | 
| 180 | 
            +
                  </html>
         | 
| 149 181 | 
             
                OUTPUT
         | 
| 150 182 | 
             
              end
         | 
| 151 183 |  | 
| 152 184 | 
             
              it "processes eref types" do
         | 
| 153 | 
            -
                 | 
| 154 | 
            -
             | 
| 155 | 
            -
             | 
| 156 | 
            -
             | 
| 157 | 
            -
             | 
| 158 | 
            -
             | 
| 159 | 
            -
             | 
| 160 | 
            -
             | 
| 161 | 
            -
             | 
| 162 | 
            -
             | 
| 163 | 
            -
             | 
| 164 | 
            -
             | 
| 165 | 
            -
             | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 168 | 
            -
             | 
| 169 | 
            -
             | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            -
             | 
| 174 | 
            -
             | 
| 185 | 
            +
                output = IsoDoc::Iso::HtmlConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 186 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 187 | 
            +
                    <preface>
         | 
| 188 | 
            +
                      <foreword>
         | 
| 189 | 
            +
                        <p>
         | 
| 190 | 
            +
                          <eref type="footnote" bibitemid="ISO712" citeas="ISO 712">A</stem>
         | 
| 191 | 
            +
                          <eref type="inline" bibitemid="ISO712" citeas="ISO 712">A</stem>
         | 
| 192 | 
            +
                        </p>
         | 
| 193 | 
            +
                      </foreword>
         | 
| 194 | 
            +
                    </preface>
         | 
| 195 | 
            +
                    <bibliography>
         | 
| 196 | 
            +
                      <references id="_normative_references" normative="true" obligation="informative">
         | 
| 197 | 
            +
                        <title>1<tab/>
         | 
| 198 | 
            +
                          Normative references</title>
         | 
| 199 | 
            +
                        <bibitem id="ISO712" type="standard">
         | 
| 200 | 
            +
                          <title format="text/plain">Cereals and cereal products</title>
         | 
| 201 | 
            +
                          <docidentifier>ISO 712</docidentifier>
         | 
| 202 | 
            +
                          <contributor>
         | 
| 203 | 
            +
                            <role type="publisher"/>
         | 
| 204 | 
            +
                            <organization>
         | 
| 205 | 
            +
                              <abbreviation>ISO</abbreviation>
         | 
| 206 | 
            +
                            </organization>
         | 
| 207 | 
            +
                          </contributor>
         | 
| 208 | 
            +
                        </bibitem>
         | 
| 209 | 
            +
                      </references>
         | 
| 210 | 
            +
                    </bibliography>
         | 
| 211 | 
            +
                  </iso-standard>
         | 
| 175 212 | 
             
                INPUT
         | 
| 176 | 
            -
                 | 
| 177 | 
            -
             | 
| 178 | 
            -
             | 
| 179 | 
            -
             | 
| 180 | 
            -
             | 
| 181 | 
            -
             | 
| 182 | 
            -
             | 
| 183 | 
            -
             | 
| 184 | 
            -
             | 
| 185 | 
            -
             | 
| 186 | 
            -
             | 
| 187 | 
            -
             | 
| 188 | 
            -
             | 
| 189 | 
            -
             | 
| 190 | 
            -
             | 
| 191 | 
            -
             | 
| 192 | 
            -
             | 
| 213 | 
            +
                expect(xmlpp(output)).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 214 | 
            +
                  #{HTML_HDR}
         | 
| 215 | 
            +
                        <br/>
         | 
| 216 | 
            +
                        <div>
         | 
| 217 | 
            +
                          <h1 class="ForewordTitle">Foreword</h1>
         | 
| 218 | 
            +
                          <p>
         | 
| 219 | 
            +
                            <sup><a href="#ISO712">A</a></sup>
         | 
| 220 | 
            +
                            <a href="#ISO712">A</a>
         | 
| 221 | 
            +
                          </p>
         | 
| 222 | 
            +
                        </div>
         | 
| 223 | 
            +
                        <p class="zzSTDTitle1"/>
         | 
| 224 | 
            +
                        <div>
         | 
| 225 | 
            +
                          <h1>1  Normative references</h1>
         | 
| 226 | 
            +
                          <p id="ISO712" class="NormRef">ISO 712, <i>Cereals and cereal products</i></p>
         | 
| 227 | 
            +
                        </div>
         | 
| 228 | 
            +
                      </div>
         | 
| 229 | 
            +
                    </body>
         | 
| 230 | 
            +
                  </html>
         | 
| 193 231 | 
             
                OUTPUT
         | 
| 194 232 | 
             
              end
         | 
| 195 233 |  | 
| 196 234 | 
             
              it "processes eref content" do
         | 
| 197 | 
            -
                 | 
| 198 | 
            -
             | 
| 199 | 
            -
             | 
| 200 | 
            -
             | 
| 201 | 
            -
             | 
| 202 | 
            -
             | 
| 203 | 
            -
             | 
| 204 | 
            -
             | 
| 205 | 
            -
             | 
| 206 | 
            -
             | 
| 207 | 
            -
             | 
| 208 | 
            -
             | 
| 209 | 
            -
             | 
| 210 | 
            -
             | 
| 211 | 
            -
             | 
| 212 | 
            -
             | 
| 213 | 
            -
             | 
| 214 | 
            -
             | 
| 215 | 
            -
             | 
| 216 | 
            -
             | 
| 217 | 
            -
            < | 
| 218 | 
            -
             | 
| 219 | 
            -
             | 
| 220 | 
            -
             | 
| 221 | 
            -
             | 
| 222 | 
            -
             | 
| 223 | 
            -
             | 
| 224 | 
            -
             | 
| 225 | 
            -
             | 
| 226 | 
            -
            </ | 
| 227 | 
            -
             | 
| 228 | 
            -
             | 
| 229 | 
            -
             | 
| 235 | 
            +
                output = IsoDoc::Iso::PresentationXMLConvert.new({}).convert("test", <<~"INPUT", true)
         | 
| 236 | 
            +
                  <iso-standard xmlns="http://riboseinc.com/isoxml">
         | 
| 237 | 
            +
                    <preface>
         | 
| 238 | 
            +
                      <foreword>
         | 
| 239 | 
            +
                        <p>
         | 
| 240 | 
            +
                          <eref bibitemid="IEV" citeas="IEV" type="inline">
         | 
| 241 | 
            +
                            <locality type="clause">
         | 
| 242 | 
            +
                              <referenceFrom>1-2-3</referenceFrom>
         | 
| 243 | 
            +
                            </locality>
         | 
| 244 | 
            +
                          </eref>
         | 
| 245 | 
            +
                          <eref bibitemid="ISO712" citeas="ISO 712" type="inline"/>
         | 
| 246 | 
            +
                          <eref bibitemid="ISO712" type="inline"/>
         | 
| 247 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 248 | 
            +
                            <locality type="table">
         | 
| 249 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 250 | 
            +
                            </locality>
         | 
| 251 | 
            +
                          </eref>
         | 
| 252 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 253 | 
            +
                            <locality type="table">
         | 
| 254 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 255 | 
            +
                              <referenceTo>1</referenceTo>
         | 
| 256 | 
            +
                            </locality>
         | 
| 257 | 
            +
                          </eref>
         | 
| 258 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 259 | 
            +
                            <locality type="clause">
         | 
| 260 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 261 | 
            +
                            </locality>
         | 
| 262 | 
            +
                            <locality type="table">
         | 
| 263 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 264 | 
            +
                            </locality>
         | 
| 265 | 
            +
                          </eref>
         | 
| 266 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 267 | 
            +
                            <locality type="clause">
         | 
| 268 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 269 | 
            +
                            </locality>
         | 
| 270 | 
            +
                            <locality type="list">
         | 
| 271 | 
            +
                              <referenceFrom>a</referenceFrom>
         | 
| 272 | 
            +
                            </locality>
         | 
| 273 | 
            +
                          </eref>
         | 
| 274 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 275 | 
            +
                            <locality type="clause">
         | 
| 276 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 277 | 
            +
                            </locality>
         | 
| 278 | 
            +
                          </eref>
         | 
| 279 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 280 | 
            +
                            <locality type="clause">
         | 
| 281 | 
            +
                              <referenceFrom>1.5</referenceFrom>
         | 
| 282 | 
            +
                            </locality>
         | 
| 283 | 
            +
                          </eref>
         | 
| 284 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 285 | 
            +
                            <locality type="table">
         | 
| 286 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 287 | 
            +
                            </locality>A</eref>
         | 
| 288 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 289 | 
            +
                            <locality type="whole"/>
         | 
| 290 | 
            +
                          </eref>
         | 
| 291 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 292 | 
            +
                            <locality type="locality:prelude">
         | 
| 293 | 
            +
                              <referenceFrom>7</referenceFrom>
         | 
| 294 | 
            +
                            </locality>
         | 
| 295 | 
            +
                          </eref>
         | 
| 296 | 
            +
                          <eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
         | 
| 297 | 
            +
                        </p>
         | 
| 298 | 
            +
                      </foreword>
         | 
| 299 | 
            +
                    </preface>
         | 
| 300 | 
            +
                    <bibliography>
         | 
| 301 | 
            +
                      <references id="_normative_references" normative="true" obligation="informative">
         | 
| 302 | 
            +
                        <title>Normative References</title>
         | 
| 303 | 
            +
                        <bibitem id="ISO712" type="standard">
         | 
| 304 | 
            +
                          <title format="text/plain">Cereals and cereal products</title>
         | 
| 305 | 
            +
                          <docidentifier>ISO 712</docidentifier>
         | 
| 306 | 
            +
                          <contributor>
         | 
| 307 | 
            +
                            <role type="publisher"/>
         | 
| 308 | 
            +
                            <organization>
         | 
| 309 | 
            +
                              <abbreviation>ISO</abbreviation>
         | 
| 310 | 
            +
                            </organization>
         | 
| 311 | 
            +
                          </contributor>
         | 
| 312 | 
            +
                        </bibitem>
         | 
| 313 | 
            +
                      </references>
         | 
| 314 | 
            +
                    </bibliography>
         | 
| 315 | 
            +
                  </iso-standard>
         | 
| 230 316 | 
             
                INPUT
         | 
| 231 | 
            -
             | 
| 232 | 
            -
             | 
| 233 | 
            -
             | 
| 234 | 
            -
             | 
| 235 | 
            -
             | 
| 236 | 
            -
             | 
| 237 | 
            -
             | 
| 238 | 
            -
             | 
| 239 | 
            -
             | 
| 240 | 
            -
             | 
| 241 | 
            -
             | 
| 242 | 
            -
             | 
| 243 | 
            -
             | 
| 244 | 
            -
             | 
| 245 | 
            -
             | 
| 246 | 
            -
             | 
| 247 | 
            -
             | 
| 248 | 
            -
             | 
| 249 | 
            -
             | 
| 250 | 
            -
             | 
| 251 | 
            -
             | 
| 252 | 
            -
             | 
| 253 | 
            -
             | 
| 254 | 
            -
             | 
| 255 | 
            -
             | 
| 256 | 
            -
             | 
| 257 | 
            -
             | 
| 258 | 
            -
             | 
| 259 | 
            -
             | 
| 260 | 
            -
             | 
| 261 | 
            -
             | 
| 262 | 
            -
             | 
| 263 | 
            -
             | 
| 264 | 
            -
             | 
| 265 | 
            -
             | 
| 266 | 
            -
             | 
| 267 | 
            -
             | 
| 268 | 
            -
             | 
| 269 | 
            -
             | 
| 270 | 
            -
             | 
| 271 | 
            -
             | 
| 272 | 
            -
             | 
| 273 | 
            -
             | 
| 274 | 
            -
             | 
| 275 | 
            -
             | 
| 276 | 
            -
             | 
| 277 | 
            -
             | 
| 278 | 
            -
             | 
| 279 | 
            -
             | 
| 280 | 
            -
             | 
| 281 | 
            -
             | 
| 282 | 
            -
             | 
| 283 | 
            -
             | 
| 284 | 
            -
             | 
| 285 | 
            -
             | 
| 286 | 
            -
             | 
| 287 | 
            -
             | 
| 288 | 
            -
             | 
| 289 | 
            -
             | 
| 290 | 
            -
             | 
| 291 | 
            -
             | 
| 292 | 
            -
             | 
| 293 | 
            -
             | 
| 294 | 
            -
             | 
| 295 | 
            -
             | 
| 296 | 
            -
             | 
| 297 | 
            -
             | 
| 298 | 
            -
             | 
| 299 | 
            -
             | 
| 300 | 
            -
             | 
| 301 | 
            -
             | 
| 302 | 
            -
             | 
| 303 | 
            -
             | 
| 304 | 
            -
             | 
| 305 | 
            -
                       </foreword>
         | 
| 306 | 
            -
                     </preface>
         | 
| 307 | 
            -
                     <bibliography>
         | 
| 308 | 
            -
                       <references id='_normative_references' obligation='informative' normative='true'>
         | 
| 309 | 
            -
                         <title depth='1'>
         | 
| 310 | 
            -
              1
         | 
| 311 | 
            -
              <tab/>
         | 
| 312 | 
            -
              Normative References
         | 
| 313 | 
            -
            </title>
         | 
| 314 | 
            -
                         <bibitem id='ISO712' type='standard'>
         | 
| 315 | 
            -
                           <title format='text/plain'>Cereals and cereal products</title>
         | 
| 316 | 
            -
                           <docidentifier>ISO 712</docidentifier>
         | 
| 317 | 
            -
                           <contributor>
         | 
| 318 | 
            -
                             <role type='publisher'/>
         | 
| 319 | 
            -
                             <organization>
         | 
| 320 | 
            -
                               <abbreviation>ISO</abbreviation>
         | 
| 321 | 
            -
                             </organization>
         | 
| 322 | 
            -
                           </contributor>
         | 
| 323 | 
            -
                         </bibitem>
         | 
| 324 | 
            -
                       </references>
         | 
| 325 | 
            -
                     </bibliography>
         | 
| 326 | 
            -
                   </iso-standard>
         | 
| 317 | 
            +
                expect(xmlpp(output).sub(%r{<i18nyaml>.*</i18nyaml>}m, "")).to be_equivalent_to xmlpp(<<~"OUTPUT")
         | 
| 318 | 
            +
                  <?xml version='1.0'?>
         | 
| 319 | 
            +
                  <iso-standard type="presentation" xmlns="http://riboseinc.com/isoxml">
         | 
| 320 | 
            +
                    <preface>
         | 
| 321 | 
            +
                      <foreword>
         | 
| 322 | 
            +
                        <p>
         | 
| 323 | 
            +
                          <eref bibitemid="IEV" citeas="IEV" type="inline">
         | 
| 324 | 
            +
                            <locality type="clause">
         | 
| 325 | 
            +
                              <referenceFrom>1-2-3</referenceFrom>
         | 
| 326 | 
            +
                            </locality>IEV, 1-2-3</eref>
         | 
| 327 | 
            +
                          <eref bibitemid="ISO712" citeas="ISO 712" type="inline">ISO 712</eref>
         | 
| 328 | 
            +
                          <eref bibitemid="ISO712" type="inline">ISO 712</eref>
         | 
| 329 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 330 | 
            +
                            <locality type="table">
         | 
| 331 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 332 | 
            +
                            </locality>ISO 712, Table 1</eref>
         | 
| 333 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 334 | 
            +
                            <locality type="table">
         | 
| 335 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 336 | 
            +
                              <referenceTo>1</referenceTo>
         | 
| 337 | 
            +
                            </locality>ISO 712, Table 1–1</eref>
         | 
| 338 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 339 | 
            +
                            <locality type="clause">
         | 
| 340 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 341 | 
            +
                            </locality>
         | 
| 342 | 
            +
                            <locality type="table">
         | 
| 343 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 344 | 
            +
                            </locality>ISO 712, Clause 1, Table 1</eref>
         | 
| 345 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 346 | 
            +
                            <locality type="clause">
         | 
| 347 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 348 | 
            +
                            </locality>
         | 
| 349 | 
            +
                            <locality type="list">
         | 
| 350 | 
            +
                              <referenceFrom>a</referenceFrom>
         | 
| 351 | 
            +
                            </locality>ISO 712, Clause 1 a)</eref>
         | 
| 352 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 353 | 
            +
                            <locality type="clause">
         | 
| 354 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 355 | 
            +
                            </locality>ISO 712, Clause 1</eref>
         | 
| 356 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 357 | 
            +
                            <locality type="clause">
         | 
| 358 | 
            +
                              <referenceFrom>1.5</referenceFrom>
         | 
| 359 | 
            +
                            </locality>ISO 712, 1.5</eref>
         | 
| 360 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 361 | 
            +
                            <locality type="table">
         | 
| 362 | 
            +
                              <referenceFrom>1</referenceFrom>
         | 
| 363 | 
            +
                            </locality>A</eref>
         | 
| 364 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 365 | 
            +
                            <locality type="whole"/>ISO 712, Whole of text</eref>
         | 
| 366 | 
            +
                          <eref bibitemid="ISO712" type="inline">
         | 
| 367 | 
            +
                            <locality type="locality:prelude">
         | 
| 368 | 
            +
                              <referenceFrom>7</referenceFrom>
         | 
| 369 | 
            +
                            </locality>ISO 712, Prelude 7</eref>
         | 
| 370 | 
            +
                          <eref bibitemid="ISO712" citeas="ISO 712" type="inline">A</eref>
         | 
| 371 | 
            +
                        </p>
         | 
| 372 | 
            +
                      </foreword>
         | 
| 373 | 
            +
                    </preface>
         | 
| 374 | 
            +
                    <bibliography>
         | 
| 375 | 
            +
                      <references id="_normative_references" normative="true" obligation="informative">
         | 
| 376 | 
            +
                        <title depth="1">1<tab/>
         | 
| 377 | 
            +
                          Normative References</title>
         | 
| 378 | 
            +
                        <bibitem id="ISO712" type="standard">
         | 
| 379 | 
            +
                          <title format="text/plain">Cereals and cereal products</title>
         | 
| 380 | 
            +
                          <docidentifier>ISO 712</docidentifier>
         | 
| 381 | 
            +
                          <contributor>
         | 
| 382 | 
            +
                            <role type="publisher"/>
         | 
| 383 | 
            +
                            <organization>
         | 
| 384 | 
            +
                              <abbreviation>ISO</abbreviation>
         | 
| 385 | 
            +
                            </organization>
         | 
| 386 | 
            +
                          </contributor>
         | 
| 387 | 
            +
                        </bibitem>
         | 
| 388 | 
            +
                      </references>
         | 
| 389 | 
            +
                    </bibliography>
         | 
| 390 | 
            +
                  </iso-standard>
         | 
| 327 391 | 
             
                OUTPUT
         | 
| 328 392 | 
             
              end
         | 
| 329 | 
            -
             | 
| 330 | 
            -
             | 
| 331 393 | 
             
            end
         |