Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix table colspan issue in text format #886

Merged
merged 2 commits into from
Sep 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions tests/input/elements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,75 @@ Definition list, third bullet, fourth element:
</tfoot>
</table>

<table>
<name>Large colspan</name>
<thead>
<tr>
<th rowspan="2">Column Title 1</th>
<th rowspan="2">Column Tilte 2</th>
<th colspan="6">Column Title 3</th>
<th colspan="2">TC 4</th>
<th colspan="2">TC 5</th>
<th colspan="2">TC 6</th>
<th colspan="2">TC 7</th>
</tr>
<tr>
<th>C1</th>
<th>C2</th>
<th>C3</th>
<th>C4</th>
<th>C5</th>
<th>C6</th>
<th>C1</th>
<th>C2</th>
<th>C1</th>
<th>C2</th>
<th>C1</th>
<th>C2</th>
<th>C1</th>
<th>C2</th>
</tr>
</thead>
<tbody>
<tr>
<td rowspan="2">Major Row 1, Column 1</td>
<td>Minor Row 1, Column 2</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
<tr>
<td>Minor Row 2, Column 2</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
</tbody>
</table>


<table align="left">
<name>Aligned left</name>
<tbody>
Expand Down
12 changes: 6 additions & 6 deletions tests/valid/docfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<meta charset="utf-8">
<meta content="Cherokee,Common,Greek,Latin" name="scripts">
<meta content="initial-scale=1.0" name="viewport">
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.14.1</title>
<title>Xml2rfc Vocabulary Version 3 Schema xml2rfc release 3.14.2</title>
<meta content="xml2rfc(1)" name="author">
<meta content="

This document provides information about the XML schema implemented in this release of xml2rfc, and the individual elements of that schema. The document is generated from the RNG schema file that is part of the xml2rfc distribution, so schema information in this document should always be in sync with the schema in actual use. The textual descriptions depend on manual updates in order to reflect the implementation.

" name="description">
<meta content="xml2rfc 3.14.1" name="generator">
<meta content="xml2rfc-docs-3.14.1" name="ietf.draft">
<meta content="xml2rfc 3.14.2" name="generator">
<meta content="xml2rfc-docs-3.14.2" name="ietf.draft">
<link href="tests/out/docfile.xml" rel="alternate" type="application/rfc+xml">
<link href="#copyright" rel="license">
<link href="xml2rfc.css" rel="stylesheet">
Expand Down Expand Up @@ -45,7 +45,7 @@
</dd>
</dl>
</div>
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.14.1</h1>
<h1 id="title">Xml2rfc Vocabulary Version 3 Schema<br>xml2rfc release 3.14.2</h1>
<section id="section-abstract">
<h2 id="abstract"><a href="#abstract" class="selfRef">Abstract</a></h2>
<p id="section-abstract-1">
Expand Down Expand Up @@ -367,7 +367,7 @@ <h2 id="name-introduction">
<p id="section-1-5">
The latest version of this documentation is available in HTML form at <span><a href="https://ietf-tools.github.io/xml2rfc/">https://ietf-tools.github.io/xml2rfc/</a></span>.<a href="#section-1-5" class="pilcrow">¶</a></p>
<p id="section-1-6">
This documentation applies to xml2rfc version 3.14.1.<a href="#section-1-6" class="pilcrow">¶</a></p>
This documentation applies to xml2rfc version 3.14.2.<a href="#section-1-6" class="pilcrow">¶</a></p>
</section>
<section id="section-2">
<h2 id="name-schema-version-3-elements">
Expand Down Expand Up @@ -6351,7 +6351,7 @@ <h2 id="name-xml2rfc-documentation-templ">
<p id="appendix-D-1">

The following variables are available for use in an xml2rfc
manpage Jinja2 template, as of xml2rfc version 3.14.1:<a href="#appendix-D-1" class="pilcrow">¶</a></p>
manpage Jinja2 template, as of xml2rfc version 3.14.2:<a href="#appendix-D-1" class="pilcrow">¶</a></p>
<span class="break"></span><dl class="dlNewline" id="appendix-D-2">
<dt id="appendix-D-2.1">{{ bare_latin_tags }}:</dt>
<dd style="margin-left: 1.5em" id="appendix-D-2.2"></dd>
Expand Down
4 changes: 2 additions & 2 deletions tests/valid/draft-miek-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
This version is adapted to work with "xml2rfc" version 2.x.

' name="description">
<meta content="xml2rfc 3.14.1" name="generator">
<meta content="xml2rfc 3.14.2" name="generator">
<meta content="RFC" name="keyword">
<meta content="Request for Comments" name="keyword">
<meta content="I-D" name="keyword">
Expand All @@ -26,7 +26,7 @@
<meta content="Extensible Markup Language" name="keyword">
<meta content="draft-gieben-writing-rfcs-pandoc-02" name="ietf.draft">
<!-- Generator version information:
xml2rfc 3.14.1
xml2rfc 3.14.2
Python 3.9.13
appdirs 1.4.4
ConfigArgParse 1.5.3
Expand Down
4 changes: 2 additions & 2 deletions tests/valid/draft-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
Insert an abstract: MANDATORY. This template is for creating an
Internet Draft.
" name="description">
<meta content="xml2rfc 3.14.1" name="generator">
<meta content="xml2rfc 3.14.2" name="generator">
<meta content="template" name="keyword">
<meta content="draft-ietf-xml2rfc-template-05" name="ietf.draft">
<!-- Generator version information:
xml2rfc 3.14.1
xml2rfc 3.14.2
Python 3.9.13
appdirs 1.4.4
ConfigArgParse 1.5.3
Expand Down
48 changes: 24 additions & 24 deletions tests/valid/elements.bom.text
Original file line number Diff line number Diff line change
Expand Up @@ -618,54 +618,54 @@ Author, et al. Expires 13 January 2019 [Page 11]
Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


+========+========+=================+=====+=====+=========+=========+
|Column |Column |Column |TC |TC | TC | TC |
|Title 1 |Tilte 2 |Title |4 |5 | 6 | 7 |
| | |3 | | | | |
| | +==+==+==+==+==+==+==+==+==+==+====+====+====+====+
| | |C1|C2|C3|C4|C5|C6|C1|C2|C1|C2| C1 | C2 | C1 | C2 |
+========+========+==+==+==+==+==+==+==+==+==+==+====+====+====+====+
|Major |Minor |x |x |x |x |x |x |x |x |x |x | x | x | x | x |
|Row 1, |Row 1, | | | | | | | | | | | | | | |
|Column 1|Column 2| | | | | | | | | | | | | | |
| +--------+--+--+--+--+--+--+--+--+--+--+----+----+----+----+
| |Minor |x |x |x |x |x |x |x |x |x |x | x | x | x | x |
| |Row 2, | | | | | | | | | | | | | | |
| |Column 2| | | | | | | | | | | | | | |
+--------+--------+--+--+--+--+--+--+--+--+--+--+----+----+----+----+

Table 2: Large colspan

+=======+======+
| One | Two |
+=======+======+
| Alpha | Beta |
+-------+------+

Table 2: Aligned left
Table 3: Aligned left

+=======+======+
| One | Two |
+=======+======+
| Alpha | Beta |
+-------+------+

Table 3: Aligned center
Table 4: Aligned center

+=======+======+
| One | Two |
+=======+======+
| Alpha | Beta |
+-------+------+

Table 4: Aligned right
Table 5: Aligned right

A really tight table where left padding cannot be applied as it would
throw the left-alignment of the text off.

























Expand Down Expand Up @@ -699,7 +699,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
| | | | |applicable | | |
+------+-----------+------+--------+-----------------+------+-------+

Table 5
Table 6

7. Unicode Literals

Expand Down Expand Up @@ -1198,7 +1198,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
| | | path) | |
+-----+-----+-------------------+--------------------+

Table 6: nNLM at nSFF1
Table 7: nNLM at nSFF1

This is an arbitrary term:
And this is some text with a table.
Expand All @@ -1219,7 +1219,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
| Cell B10 | Empty Cell: | |
+----------+-------------+----------+

Table 7
Table 8

15. Wide artwork

Expand Down
48 changes: 24 additions & 24 deletions tests/valid/elements.pages.text
Original file line number Diff line number Diff line change
Expand Up @@ -618,54 +618,54 @@ Author, et al. Expires January 13, 2019 [Page 11]
Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


+========+========+=================+=====+=====+=========+=========+
|Column |Column |Column |TC |TC | TC | TC |
|Title 1 |Tilte 2 |Title |4 |5 | 6 | 7 |
| | |3 | | | | |
| | +==+==+==+==+==+==+==+==+==+==+====+====+====+====+
| | |C1|C2|C3|C4|C5|C6|C1|C2|C1|C2| C1 | C2 | C1 | C2 |
+========+========+==+==+==+==+==+==+==+==+==+==+====+====+====+====+
|Major |Minor |x |x |x |x |x |x |x |x |x |x | x | x | x | x |
|Row 1, |Row 1, | | | | | | | | | | | | | | |
|Column 1|Column 2| | | | | | | | | | | | | | |
| +--------+--+--+--+--+--+--+--+--+--+--+----+----+----+----+
| |Minor |x |x |x |x |x |x |x |x |x |x | x | x | x | x |
| |Row 2, | | | | | | | | | | | | | | |
| |Column 2| | | | | | | | | | | | | | |
+--------+--------+--+--+--+--+--+--+--+--+--+--+----+----+----+----+

Table 2: Large colspan

+=======+======+
| One | Two |
+=======+======+
| Alpha | Beta |
+-------+------+

Table 2: Aligned left
Table 3: Aligned left

+=======+======+
| One | Two |
+=======+======+
| Alpha | Beta |
+-------+------+

Table 3: Aligned center
Table 4: Aligned center

+=======+======+
| One | Two |
+=======+======+
| Alpha | Beta |
+-------+------+

Table 4: Aligned right
Table 5: Aligned right

A really tight table where left padding cannot be applied as it would
throw the left-alignment of the text off.

























Expand Down Expand Up @@ -699,7 +699,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
| | | | |applicable | | |
+------+-----------+------+--------+-----------------+------+-------+

Table 5
Table 6

7. Unicode Literals

Expand Down Expand Up @@ -1198,7 +1198,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
| | | path) | |
+-----+-----+-------------------+--------------------+

Table 6: nNLM at nSFF1
Table 7: nNLM at nSFF1

This is an arbitrary term:
And this is some text with a table.
Expand All @@ -1219,7 +1219,7 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
| Cell B10 | Empty Cell: | |
+----------+-------------+----------+

Table 7
Table 8

15. Wide artwork

Expand Down
Loading