diff --git a/test.py b/test.py
index b525ccc8..3c2dd5d5 100644
--- a/test.py
+++ b/test.py
@@ -712,7 +712,7 @@ def test_render_artwork_svg_only(self):
self.writer.rfcnumber = 1234
lines = self.writer.render_artwork(artwork, width=60)
text = ''.join(line.text for line in lines)
- self.assertIn("Artwork only available as svg", text)
+ self.assertIn("Artwork only available as SVG", text)
self.assertIn(default_options.rfc_html_archive_url, text)
self.assertIn('rfc1234.html', text)
@@ -720,10 +720,53 @@ def test_render_artwork_svg_only(self):
self.writer.options.rfc = None
lines = self.writer.render_artwork(artwork, width=60)
text = ' '.join(line.text for line in lines)
- self.assertIn("Artwork only available as svg", text)
+ self.assertIn("Artwork only available as SVG", text)
self.assertIn(default_options.id_html_archive_url, text)
self.assertIn(".html", text)
+ def test_render_artwork_binary_art_only(self):
+ artwork_str = ''
+ artwork = lxml.etree.fromstring(artwork_str)
+
+ # for RFC
+ self.writer.root = lxml.etree.fromstring(f'')
+ self.writer.options.rfc = True
+ self.writer.rfcnumber = 1234
+ lines = self.writer.render_artwork(artwork, width=60)
+ text = ''.join(line.text for line in lines)
+ self.assertIn("Artwork only available as BINARY-ART", text)
+ self.assertIn(default_options.rfc_html_archive_url, text)
+ self.assertIn('rfc1234.html', text)
+
+ # for Draft
+ self.writer.options.rfc = None
+ lines = self.writer.render_artwork(artwork, width=60)
+ text = ' '.join(line.text for line in lines)
+ self.assertIn("Artwork only available as BINARY-ART", text)
+ self.assertIn(default_options.id_html_archive_url, text)
+ self.assertIn(".html", text)
+
+ def test_render_artwork_non_ascii_unknown(self):
+ artwork_str = ''
+ artwork = lxml.etree.fromstring(artwork_str)
+
+ # for RFC
+ self.writer.root = lxml.etree.fromstring(f'')
+ self.writer.options.rfc = True
+ self.writer.rfcnumber = 1234
+ lines = self.writer.render_artwork(artwork, width=60)
+ text = ''.join(line.text for line in lines)
+ self.assertIn("Artwork only available as (unknown type)", text)
+ self.assertIn(default_options.rfc_html_archive_url, text)
+ self.assertIn('rfc1234.html', text)
+
+ # for Draft
+ self.writer.options.rfc = None
+ lines = self.writer.render_artwork(artwork, width=60)
+ text = ' '.join(line.text for line in lines)
+ self.assertIn("Artwork only available as (unknown type)", text)
+ self.assertIn(default_options.id_html_archive_url, text)
+ self.assertIn(".html", text)
class BaseV3WriterTest(unittest.TestCase):
diff --git a/tests/valid/draft-v3-features.text b/tests/valid/draft-v3-features.text
index cab29a6f..62e42ff3 100644
--- a/tests/valid/draft-v3-features.text
+++ b/tests/valid/draft-v3-features.text
@@ -519,7 +519,7 @@ Table of Contents
Text before...
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/draft-v3-features.html)
Text after...
@@ -528,7 +528,7 @@ Table of Contents
Text before...
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/draft-v3-features.html)
Text after...
@@ -537,7 +537,7 @@ Table of Contents
Text before...
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/draft-v3-features.html)
Text after...
@@ -546,14 +546,14 @@ Table of Contents
Text before...
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/draft-v3-features.html)
Text after...
8.5. included (type svg)
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/draft-v3-features.html)
+--------------------+
| Included from file |
diff --git a/tests/valid/elements.bom.text b/tests/valid/elements.bom.text
index aa9f5d78..d658816e 100644
--- a/tests/valid/elements.bom.text
+++ b/tests/valid/elements.bom.text
@@ -355,12 +355,12 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
* Artset include with
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
* Unicode SVG rendering test
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
4. Ordered list with sub-elements
diff --git a/tests/valid/elements.pages.text b/tests/valid/elements.pages.text
index 74cb129a..371752ff 100644
--- a/tests/valid/elements.pages.text
+++ b/tests/valid/elements.pages.text
@@ -355,12 +355,12 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
* Artset include with
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
* Unicode SVG rendering test
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
4. Ordered list with sub-elements
diff --git a/tests/valid/elements.text b/tests/valid/elements.text
index 52aa5c46..7c9c2099 100644
--- a/tests/valid/elements.text
+++ b/tests/valid/elements.text
@@ -302,12 +302,12 @@ Table of Contents
* Artset include with
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
* Unicode SVG rendering test
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
4. Ordered list with sub-elements
diff --git a/tests/valid/elements.wip.text b/tests/valid/elements.wip.text
index 843255c2..9261689e 100644
--- a/tests/valid/elements.wip.text
+++ b/tests/valid/elements.wip.text
@@ -355,12 +355,12 @@ Internet-Draft Xml2rfc Vocabulary V3 Elements July 2018
* Artset include with
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
* Unicode SVG rendering test
- (Artwork only available as svg: see
+ (Artwork only available as SVG: see
https://www.ietf.org/archive/id/elements-00.html)
4. Ordered list with sub-elements
diff --git a/tests/valid/indexes.pages.text b/tests/valid/indexes.pages.text
index 989b67bb..5daab1e6 100644
--- a/tests/valid/indexes.pages.text
+++ b/tests/valid/indexes.pages.text
@@ -3,9 +3,9 @@
Network Working Group H. Person, Ed.
-Internet-Draft September 20, 2024
+Internet-Draft September 26, 2024
Intended status: Experimental
-Expires: March 24, 2025
+Expires: March 30, 2025
xml2rfc index tests
@@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
- This Internet-Draft will expire on March 24, 2025.
+ This Internet-Draft will expire on March 30, 2025.
Copyright Notice
@@ -53,7 +53,7 @@ Table of Contents
-Person Expires March 24, 2025 [Page 1]
+Person Expires March 30, 2025 [Page 1]
Internet-Draft xml2rfc index tests September 2024
@@ -109,7 +109,7 @@ Index
-Person Expires March 24, 2025 [Page 2]
+Person Expires March 30, 2025 [Page 2]
Internet-Draft xml2rfc index tests September 2024
@@ -165,4 +165,4 @@ Author's Address
-Person Expires March 24, 2025 [Page 3]
+Person Expires March 30, 2025 [Page 3]
diff --git a/tests/valid/indexes.prepped.xml b/tests/valid/indexes.prepped.xml
index e617b237..913b1e83 100644
--- a/tests/valid/indexes.prepped.xml
+++ b/tests/valid/indexes.prepped.xml
@@ -1,5 +1,5 @@
-
+
@@ -20,7 +20,7 @@
-
+ Status of This Memo
@@ -41,7 +41,7 @@
material or to cite them other than as "work in progress."
- This Internet-Draft will expire on 24 March 2025.
+ This Internet-Draft will expire on 30 March 2025.
diff --git a/tests/valid/indexes.text b/tests/valid/indexes.text
index 1c63e764..8bef89ec 100644
--- a/tests/valid/indexes.text
+++ b/tests/valid/indexes.text
@@ -3,9 +3,9 @@
Network Working Group H. Person, Ed.
-Internet-Draft September 20, 2024
+Internet-Draft September 26, 2024
Intended status: Experimental
-Expires: March 24, 2025
+Expires: March 30, 2025
xml2rfc index tests
@@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
- This Internet-Draft will expire on March 24, 2025.
+ This Internet-Draft will expire on March 30, 2025.
Copyright Notice
diff --git a/tests/valid/indexes.v3.html b/tests/valid/indexes.v3.html
index b004e0a8..36a10245 100644
--- a/tests/valid/indexes.v3.html
+++ b/tests/valid/indexes.v3.html
@@ -23,7 +23,7 @@
Person
-
Expires March 24, 2025
+
Expires March 30, 2025
[Page]
@@ -36,12 +36,12 @@
indexes-00
Published:
-
+
Intended Status:
Experimental
Expires:
-
+
Author:
@@ -71,7 +71,7 @@
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."¶
- This Internet-Draft will expire on March 24, 2025.¶
+ This Internet-Draft will expire on March 30, 2025.¶
diff --git a/tests/valid/manpage.txt b/tests/valid/manpage.txt
index e8915da9..94b35e4c 100644
--- a/tests/valid/manpage.txt
+++ b/tests/valid/manpage.txt
@@ -1,5 +1,5 @@
xml2rfc(1) xml2rfc(1)
- 20 September 2024
+ 26 September 2024
Xml2rfc Vocabulary Version 3 Schema
diff --git a/tests/valid/sourcecode.pages.text b/tests/valid/sourcecode.pages.text
index e75391bf..9285fe75 100644
--- a/tests/valid/sourcecode.pages.text
+++ b/tests/valid/sourcecode.pages.text
@@ -3,9 +3,9 @@
Network Working Group H. Person, Ed.
-Internet-Draft September 20, 2024
+Internet-Draft September 26, 2024
Intended status: Experimental
-Expires: March 24, 2025
+Expires: March 30, 2025
xml2rfc sourcecode tests
@@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
- This Internet-Draft will expire on March 24, 2025.
+ This Internet-Draft will expire on March 30, 2025.
Copyright Notice
@@ -53,7 +53,7 @@ Table of Contents
-Person Expires March 24, 2025 [Page 1]
+Person Expires March 30, 2025 [Page 1]
Internet-Draft xml2rfc sourcecode tests September 2024
@@ -109,7 +109,7 @@ Internet-Draft xml2rfc sourcecode tests September 2024
-Person Expires March 24, 2025 [Page 2]
+Person Expires March 30, 2025 [Page 2]
Internet-Draft xml2rfc sourcecode tests September 2024
@@ -165,7 +165,7 @@ Internet-Draft xml2rfc sourcecode tests September 2024
-Person Expires March 24, 2025 [Page 3]
+Person Expires March 30, 2025 [Page 3]
Internet-Draft xml2rfc sourcecode tests September 2024
@@ -221,4 +221,4 @@ Author's Address
-Person Expires March 24, 2025 [Page 4]
+Person Expires March 30, 2025 [Page 4]
diff --git a/tests/valid/sourcecode.prepped.xml b/tests/valid/sourcecode.prepped.xml
index f50a1370..205bc681 100644
--- a/tests/valid/sourcecode.prepped.xml
+++ b/tests/valid/sourcecode.prepped.xml
@@ -1,5 +1,5 @@
-
+
@@ -20,7 +20,7 @@
-
+ Status of This Memo
@@ -41,7 +41,7 @@
material or to cite them other than as "work in progress."
- This Internet-Draft will expire on 24 March 2025.
+ This Internet-Draft will expire on 30 March 2025.
diff --git a/tests/valid/sourcecode.text b/tests/valid/sourcecode.text
index 19a1eac3..1baa5343 100644
--- a/tests/valid/sourcecode.text
+++ b/tests/valid/sourcecode.text
@@ -3,9 +3,9 @@
Network Working Group H. Person, Ed.
-Internet-Draft September 20, 2024
+Internet-Draft September 26, 2024
Intended status: Experimental
-Expires: March 24, 2025
+Expires: March 30, 2025
xml2rfc sourcecode tests
@@ -26,7 +26,7 @@ Status of This Memo
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
- This Internet-Draft will expire on March 24, 2025.
+ This Internet-Draft will expire on March 30, 2025.
Copyright Notice
diff --git a/tests/valid/sourcecode.v3.html b/tests/valid/sourcecode.v3.html
index 85653112..3baf5d80 100644
--- a/tests/valid/sourcecode.v3.html
+++ b/tests/valid/sourcecode.v3.html
@@ -23,7 +23,7 @@
Person
-
Expires March 24, 2025
+
Expires March 30, 2025
[Page]
@@ -36,12 +36,12 @@
sourcecode-00
Published:
-
+
Intended Status:
Experimental
Expires:
-
+
Author:
@@ -71,7 +71,7 @@
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."¶
- This Internet-Draft will expire on March 24, 2025.¶
+ This Internet-Draft will expire on March 30, 2025.¶
diff --git a/xml2rfc/writers/text.py b/xml2rfc/writers/text.py
index d5a21090..47261ff7 100644
--- a/xml2rfc/writers/text.py
+++ b/xml2rfc/writers/text.py
@@ -814,7 +814,8 @@ def render_artwork(self, e, width, **kwargs):
if self.options.rfc
else f"{self.options.id_html_archive_url}{self.root.get('docName')}.html"
)
- msg = f"(Artwork only available as {e.get('type', '(unknown type)')}: see {artwork_url})"
+ artwork_type = e.get("type", "").upper() or "(unknown type)"
+ msg = f"(Artwork only available as {artwork_type}: see {artwork_url})"
msg = fill(msg, width=width, keep_url=True, **kwargs)
# text = (e.text.strip(stripspace) and e.text.expandtabs()) or msg
# text = text.strip('\n')