spec/isodoc/blocks_spec.rb in isodoc-1.0.10 vs spec/isodoc/blocks_spec.rb in isodoc-1.0.11
- old
+ new
@@ -270,11 +270,10 @@
<p class="FigureTitle" style="text-align:center;">Figure 2</p>
</div>
<div class="figure" id="figure-C">
<pre>A <
B</pre>
-<p class="FigureTitle" style="text-align:center;"/>
</div>
</div>
<p class="zzSTDTitle1"/>
</div>
</body>
@@ -429,18 +428,26 @@
<preface><foreword>
<sourcecode lang="ruby" id="samplecode">
<name>Ruby <em>code</em></name>
puts x
</sourcecode>
+<sourcecode unnumbered="true">
+Que?
+</sourcecode>
</foreword></preface>
</iso-standard>
INPUT
#{HTML_HDR}
<br/>
<div>
<h1 class="ForewordTitle">Foreword</h1>
<pre id="samplecode" class="prettyprint lang-rb"><br/>    <br/>  puts x<br/><p class="SourceTitle" style="text-align:center;">Figure 1 — Ruby <i>code</i></p></pre>
+ <pre class='prettyprint '>
+ <br/>
+ Que?
+ <br/>
+</pre>
</div>
<p class="zzSTDTitle1"/>
</div>
</body>
</html>
@@ -453,10 +460,13 @@
<preface><foreword>
<sourcecode lang="ruby" id="samplecode">
<name>Ruby <em>code</em></name>
puts x
</sourcecode>
+<sourcecode unnumbered="true">
+Que?
+</sourcecode>
</foreword></preface>
</iso-standard>
INPUT
<html xmlns:epub="http://www.idpf.org/2007/ops" lang="en">
<head><style/></head>
@@ -472,10 +482,15 @@
<br clear="all" style="mso-special-character:line-break;page-break-before:always"/>
</p>
<div>
<h1 class="ForewordTitle">Foreword</h1>
<p id="samplecode" class="Sourcecode"><br/>    <br/>  puts x<br/></p><p class="SourceTitle" style="text-align:center;">Figure 1 — Ruby <i>code</i></p>
+ <p class='Sourcecode'>
+ <br/>
+ Que?
+ <br/>
+</p>
</div>
<p> </p>
</div>
<p>
<br clear="all" class="section"/>
@@ -1064,8 +1079,55 @@
        <span style="font-variant:small-caps;">B</span></p>
<p class="pseudocode" style="page-break-after:avoid;"><a name="_" id="_"></a>  <i>C</i></p><p class="SourceTitle" style="text-align:center;">Figure 1 — Label</p></div>
OUTPUT
end
+ it "does not label embedded figures, sourcecode" do
+ expect(xmlpp(IsoDoc::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
+<itu-standard xmlns="http://riboseinc.com/isoxml">
+ <bibdata>
+ <language>en</language>
+ </bibdata>
+ <preface><foreword>
+ <example>
+ <sourcecode id="B"><name>Label</name>A B C</sourcecode>
+ <figure id="A" class="pseudocode"><name>Label</name><p id="_"> <strong>A</strong></p></figure>
+ <sourcecode id="B1">A B C</sourcecode>
+ <figure id="A1" class="pseudocode"><p id="_"> <strong>A</strong></p></figure>
+</example>
+</preface></itu-standard>
+INPUT
+ #{HTML_HDR}
+ <br/>
+ <div>
+ <h1 class='ForewordTitle'>Foreword</h1>
+ <div class='example'>
+ <p class='example-title'>EXAMPLE</p>
+ <pre id='B' class='prettyprint '>
+ A B C
+ <p class='SourceTitle' style='text-align:center;'>Label</p>
+ </pre>
+ <div id='A' class='pseudocode'>
+ <p id='_'>
+   
+ <b>A</b>
+ </p>
+ <p class='SourceTitle' style='text-align:center;'>Label</p>
+ </div>
+ <pre id='B1' class='prettyprint '>A B C</pre>
+ <div id='A1' class='pseudocode'>
+ <p id='_'>
+   
+ <b>A</b>
+ </p>
+ </div>
+ </div>
+ </div>
+ <p class='zzSTDTitle1'/>
+ </div>
+ </body>
+ </html>
+ OUTPUT
+ end
end