Skip to content

Commit

Permalink
Merged in [3887] and [3889] from jennifer@painless-security.com:\n Si…
Browse files Browse the repository at this point in the history
…mplify text rendering of super/subscripts. Based on patch submitted by <martin.thomson@gmail.com> and refinement from subsequent list discussion. Fixes #590.

 - Legacy-Id: 3904
Note: SVN reference [3887] has been migrated to Git commit 65f2676

Note: SVN reference [3889] has been migrated to Git commit 28d2f44
  • Loading branch information
rjsparks committed Mar 16, 2021
1 parent cdd7008 commit 0979a66
Show file tree
Hide file tree
Showing 12 changed files with 479 additions and 235 deletions.
11 changes: 11 additions & 0 deletions cli/tests/input/elements.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,18 @@ for opt, value in opts:
<name>Sup and sub</name>
<dl>
<dt>Sup</dt><dd>Text with superscript<sup>2</sup></dd>
<dt>Sup</dt><dd>Simple superscript expressions: x<sup>-1</sup> y<sup>+3.0</sup> z<sup>3.2a</sup></dd>
<dt>Sup</dt><dd>More simple superscript expressions: x<sup>1.2</sup> y<sup>n0</sup></dd>
<dt>Sup</dt><dd>Parenthetical expressions in superscript: x<sup>(n+1)</sup> y<sup>-(k-1)</sup> z<sup>(_c)</sup></dd>
<dt>Sup</dt><dd>Compound superscript expressions: x<sup>x+y</sup> y<sup>_c</sup> z<sup>a.0</sup></dd>
<dt>Sup</dt><dd>One word <sup>superscript</sup> or two <sup>words superscript</sup></dd>
<dt>Sup</dt><dd>Text with sub inside superscript<sup>x<sub>2</sub></sup></dd>
<dt>Sub</dt><dd>Text with subscript<sub>2</sub></dd>
<dt>Sub</dt><dd>Simple subscript expressions: x<sub>-1</sub> y<sub>+3.0</sub> z<sub>3.2a</sub></dd>
<dt>Sub</dt><dd>More simple subscript expressions: x<sub>1.2</sub> y<sub>n0</sub></dd>
<dt>Sub</dt><dd>Parenthetical expressions in subscript: x<sub>(n+1)</sub> y<sub>-(k-1)</sub> z<sub>(_c)</sub></dd>
<dt>Sub</dt><dd>Compound subscript expressions: x<sub>x+y</sub> y<sub>_c</sub> z<sub>a.0</sub></dd>
<dt>Sub</dt><dd>One word <sub>subscript</sub> or two <sub>words subscript</sub></dd>
<dt>Sub</dt><dd>Text with super inside subscript<sub>x<sup>2</sup></sub></dd>

</dl>
Expand Down
6 changes: 3 additions & 3 deletions cli/tests/valid/draft-v3-features.text
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Table of Contents
This is regular text. This is regular text. This is regular text.
This is regular text. This is regular text. This is regular text.
This is regular text. This is regular text. This is regular text.
This is regular text. This is s_(ubscript). This is s^(uperscript).
This is regular text. This is s_ubscript. This is s^uperscript.
This is regular text. This is regular text. This is regular text.
This is regular text. This is regular text. This is regular text.
This is regular text. This is regular text. This is regular text.
Expand Down Expand Up @@ -614,8 +614,8 @@ Table of Contents
| Column 1 | Line 1 |
| | Line 2 |
+=============================================+===================+
| The _quick_ ^(brown) _(fox) *jumps* over | Paragraph 1 |
| the lazy OPTIONAL "dog". Table 9 | |
| The _quick_ ^brown _fox *jumps* over the | Paragraph 1 |
| lazy OPTIONAL "dog". Table 9 | |
| https://en.wikipedia.org/wiki/ | Paragraph 2 |
| The_quick_brown_fox_jumps_over_the_lazy_dog | |
| // comment | Source code |
Expand Down
138 changes: 69 additions & 69 deletions cli/tests/valid/elements.bom.text
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ Table of Contents
15. Wide artwork . . . . . . . . . . . . . . . . . . . . . . . . 21
16. Sup and sub . . . . . . . . . . . . . . . . . . . . . . . . . 22
Unnumbered section . . . . . . . . . . . . . . . . . . . . . . . 22
References . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Normative References . . . . . . . . . . . . . . . . . . . . . 22
References . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Normative References . . . . . . . . . . . . . . . . . . . . . 23
Informative References . . . . . . . . . . . . . . . . . . . . 23
CMS References . . . . . . . . . . . . . . . . . . . . . . . 23
ESS References . . . . . . . . . . . . . . . . . . . . . . . 23
MIME-SPEC References . . . . . . . . . . . . . . . . . . . . 23
ESS References . . . . . . . . . . . . . . . . . . . . . . . 24
MIME-SPEC References . . . . . . . . . . . . . . . . . . . . 24
Other References . . . . . . . . . . . . . . . . . . . . . . 24
Appendix A. Some Back Matter . . . . . . . . . . . . . . . . . . 25
A.1. Contributors . . . . . . . . . . . . . . . . . . . . . . 25
A.2. Arbitrary^(superscript) in section _title_ . . . . . . . 25
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 25
A.2. Arbitrary^superscript in section _title_ . . . . . . . . 26
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26

1. RFC 2119 key words

Expand Down Expand Up @@ -1180,11 +1180,34 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018

16. Sup and sub

Sup Text with superscript^(2)
Sup Text with superscript^2

Sub Text with subscript_(2)
Sup Simple superscript expressions: x^-1 y^+3.0 z^3.2a

Sub Text with super inside subscript_(x^(2))
Sup More simple superscript expressions: x^1.2 y^n0

Sup Parenthetical expressions in superscript: x^(n+1) y^-(k-1)
z^(_c)

Sup Compound superscript expressions: x^(x+y) y^(_c) z^(a.0)

Sup One word ^superscript or two ^(words superscript)

Sup Text with sub inside superscript^(x_2)

Sub Text with subscript_2

Sub Simple subscript expressions: x_-1 y_+3.0 z_3.2a

Sub More simple subscript expressions: x_1.2 y_n0

Sub Parenthetical expressions in subscript: x_(n+1) y_-(k-1) z_(_c)

Sub Compound subscript expressions: x_(x+y) y_(_c) z_(a.0)

Sub One word _subscript or two _(words subscript)

Sub Text with super inside subscript_(x^2)

Unnumbered section

Expand All @@ -1203,6 +1226,14 @@ Unnumbered section
1. Indent="5". Lorem ipsum dolor sit amet, consectetur adipiscing
elit. Ut pharetra neque vulputate dolor elementum sodales.




Author, et al. Expires 13 January 2019 [Page 22]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


2. Item 2

* Indent="5". "The heaviest penalty for declining to rule is to
Expand All @@ -1224,16 +1255,6 @@ Normative References
DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.






Author, et al. Expires 13 January 2019 [Page 22]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


[RFC7997] Flanagan, H., Ed., "The Use of Non-ASCII Characters in
RFCs", IAB, RFC 7997, DOI 10.17487/RFC7997, December 2016,
<https://www.rfc-editor.org/info/rfc7997>.
Expand Down Expand Up @@ -1262,6 +1283,13 @@ CMS References
RFC 5652, DOI 10.17487/RFC5652, September 2009,
<https://www.rfc-editor.org/info/rfc5652>.



Author, et al. Expires 13 January 2019 [Page 23]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


ESS References

[RFC2634] Hoffman, P., Ed., "Enhanced Security Services for S/MIME",
Expand All @@ -1280,16 +1308,6 @@ MIME-SPEC References
Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996,
<https://www.rfc-editor.org/info/rfc2045>.






Author, et al. Expires 13 January 2019 [Page 23]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


[RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Two: Media Types", RFC 2046,
DOI 10.17487/RFC2046, November 1996,
Expand Down Expand Up @@ -1320,6 +1338,14 @@ Other References
[DATE-RANGE]
Moe, J., "Document with date range", 2002-2003.




Author, et al. Expires 13 January 2019 [Page 24]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


[FUZZY-DATE]
Mae, J., "Document with fuzzy date", Second quarter 2010.

Expand All @@ -1334,18 +1360,6 @@ Other References
host table specification", RFC 952, DOI 10.17487/RFC0952,
October 1985, <https://www.rfc-editor.org/info/rfc952>.








Author, et al. Expires 13 January 2019 [Page 24]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


Appendix A. Some Back Matter

Fusce viverra ipsum tempor finibus pharetra. Vestibulum fermentum
Expand Down Expand Up @@ -1381,7 +1395,14 @@ A.1. Contributors
Reviews and helpful comments have also been received from ანა
კიკაბიძე (Ana Kikabidze).

A.2. Arbitrary^(superscript) in section _title_


Author, et al. Expires 13 January 2019 [Page 25]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


A.2. Arbitrary^superscript in section _title_

Arbitrary text

Expand All @@ -1396,12 +1417,6 @@ Authors' Addresses
Email: henrik@levkowetz.com, henrik@tools.ietf.org



Author, et al. Expires 13 January 2019 [Page 25]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


Roni Even
Huawei
David Hamelech 14
Expand Down Expand Up @@ -1437,6 +1452,12 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
3階B号室



Author, et al. Expires 13 January 2019 [Page 26]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


No Org
Tokyo
112-0001
Expand All @@ -1452,12 +1473,6 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
Belgium



Author, et al. Expires 13 January 2019 [Page 26]

Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018


International Association for Cryptologic Research


Expand Down Expand Up @@ -1486,21 +1501,6 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018





















Expand Down
Loading

0 comments on commit 0979a66

Please sign in to comment.