SF.net SVN: docutils:[10075 ] trunk
grubert--- via Docutils-checkins <[email protected]> Sun, 06 Apr 2025 16:49:57 +0000
| Newsgroups | gmane.text.docutils.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 10075
http://sourceforge.net/p/docutils/code/10075
Author: grubert
Date: 2025-04-06 16:49:55 +0000 (Sun, 06 Apr 2025)
Log Message:
-----------
macro-references: remove "mailto:" from refuris in the .MT line.
man/groff adds one ... but mandoc does not :-/
Modified Paths:
--------------
trunk/docutils/HISTORY.rst
trunk/docutils/docutils/writers/manpage.py
trunk/docutils/test/test_writers/test_manpage.py
trunk/sandbox/manpage-writer/expected/ref-2025-urue.man
trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8
trunk/sandbox/manpage-writer/expected/refs-urue.man
trunk/sandbox/manpage-writer/expected/refs-urue.utf8
trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8
trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man
trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps
trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8
Modified: trunk/docutils/HISTORY.rst
===================================================================
--- trunk/docutils/HISTORY.rst 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/docutils/HISTORY.rst 2025-04-06 16:49:55 UTC (rev 10075)
@@ -217,6 +217,8 @@
- text-references: no line end after refuri, no additional spaces.
- text-references: Skip references only if content is equal, or only differs
by "mailto:".
+ - macro-references: remove "mailto:" from refuris in the .MT line.
+ man/groff adds one ... but mandoc does not :-/
* docutils/writers/null.py
Modified: trunk/docutils/docutils/writers/manpage.py
===================================================================
--- trunk/docutils/docutils/writers/manpage.py 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/docutils/docutils/writers/manpage.py 2025-04-06 16:49:55 UTC (rev 10075)
@@ -1113,13 +1113,15 @@
# TODO insert_URI_breakpoints in text or refuri
if 'refuri' in node:
self.ensure_c_eol() # c_eol avoids space before the refuri
- if node['refuri'].startswith('mailto:'):
+ _uri = node['refuri']
+ if _uri.startswith('mailto:'):
+ _uri = _uri[7:] # remove "mailto:"
self.body.append(".MT ")
self.context.append('.ME\n')
else:
self.body.append(".UR ")
self.context.append('.UE\n')
- self.body.append("%s\n" % node['refuri'])
+ self.body.append("%s\n" % _uri)
else:
self.context.append('')
Modified: trunk/docutils/test/test_writers/test_manpage.py
===================================================================
--- trunk/docutils/test/test_writers/test_manpage.py 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/docutils/test/test_writers/test_manpage.py 2025-04-06 16:49:55 UTC (rev 10075)
@@ -170,7 +170,7 @@
document_start + indend_macros + """.TH "" "" "" ""
.SH Name
\\- \n\
-.MT mailto:[email protected]
+.MT [email protected]
Write to me
.ME \\c
with your questions.
@@ -188,7 +188,7 @@
.SH Name
\\- \n\
email: (\\c
-.MT mailto:[email protected]
+.MT [email protected]
[email protected]
.ME \\c
).
Modified: trunk/sandbox/manpage-writer/expected/ref-2025-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected/ref-2025-urue.man 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected/ref-2025-urue.man 2025-04-06 16:49:55 UTC (rev 10075)
@@ -34,7 +34,7 @@
.\" from bugs#497
.
Aaaaa (\c
-.MT mailto:[email protected]
+.MT [email protected]
[email protected]
.ME \c
),
@@ -42,7 +42,7 @@
Bbb
.UE \c
(\c
-.MT mailto:[email protected]
+.MT [email protected]
[email protected]
.ME \c
).
Modified: trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected/ref-2025-urue.utf8 2025-04-06 16:49:55 UTC (rev 10075)
@@ -1,6 +1,6 @@
() ()
[1mName[0m
- - Aaaaa (]8;;mailto:mailto:[email protected]\[email protected]]8;;\), ]8;;https://github.com/cc\Bbb]8;;\ (]8;;mailto:mailto:[email protected]\[email protected]]8;;\). ]8;;https://github.com/m\mm]8;;\ ]8;;https://github.com/nn\nn]8;;\ and ]8;;https://github.com/OooOoooo\OooOoooo]8;;\.
+ - Aaaaa (]8;;mailto:[email protected]\[email protected]]8;;\), ]8;;https://github.com/cc\Bbb]8;;\ (]8;;mailto:[email protected]\[email protected]]8;;\). ]8;;https://github.com/m\mm]8;;\ ]8;;https://github.com/nn\nn]8;;\ and ]8;;https://github.com/OooOoooo\OooOoooo]8;;\.
()
Modified: trunk/sandbox/manpage-writer/expected/refs-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected/refs-urue.man 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected/refs-urue.man 2025-04-06 16:49:55 UTC (rev 10075)
@@ -137,7 +137,7 @@
.UE \c
home page for info.
.sp
-.MT mailto:[email protected]
+.MT [email protected]
Write to me
.ME \c
with your questions.
@@ -164,7 +164,7 @@
.SS Standalone email addresses
.sp
like \c
-.MT mailto:[email protected]
+.MT [email protected]
[email protected]
.ME
.
Modified: trunk/sandbox/manpage-writer/expected/refs-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected/refs-urue.utf8 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected/refs-urue.utf8 2025-04-06 16:49:55 UTC (rev 10075)
@@ -73,7 +73,7 @@
[1mand[0m
See the ]8;;https://www.python.org/\Python]8;;\ home page for info.
- ]8;;mailto:mailto:[email protected]\Write to me]8;;\ with your questions.
+ ]8;;mailto:[email protected]\Write to me]8;;\ with your questions.
[1mURIs with known schemes[0m
]8;;tel:+48-816-555-1212\tel:+48-816-555-1212]8;;\ ]8;;urn:isbn:0-486-27557-4\urn:isbn:0-486-27557-4]8;;\ ]8;;news:comp.infosystems.www.servers.unix\news:comp.infosys‐
@@ -81,6 +81,6 @@
tions/?tag=network‐ ing&order=newest#top]8;;\
[1mStandalone email addresses[0m
- like ]8;;mailto:mailto:[email protected]\[email protected]]8;;\
+ like ]8;;mailto:[email protected]\[email protected]]8;;\
()
Modified: trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected-mandoc/ref-2025-urue.utf8 2025-04-06 16:49:55 UTC (rev 10075)
@@ -1,8 +1,8 @@
() ()
NNaammee
- - Aaaaa ([email protected] <mailto:[email protected]>), Bbb <https://github.com/cc>
- ([email protected] <mailto:[email protected]>). mm <https://github.com/m> nn
+ - Aaaaa ([email protected] <[email protected]>), Bbb <https://github.com/cc>
+ ([email protected] <[email protected]>). mm <https://github.com/m> nn
<https://github.com/nn> and OooOoooo <https://github.com/OooOoooo>.
()
Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.man 2025-04-06 16:49:55 UTC (rev 10075)
@@ -137,7 +137,7 @@
.UE \c
home page for info.
.sp
-.MT mailto:[email protected]
+.MT [email protected]
Write to me
.ME \c
with your questions.
@@ -164,7 +164,7 @@
.SS Standalone email addresses
.sp
like \c
-.MT mailto:[email protected]
+.MT [email protected]
[email protected]
.ME
.
Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.ps 2025-04-06 16:49:55 UTC (rev 10075)
@@ -261,10 +261,10 @@
87.274 210.540(Write)s
115.071(to)c
126.379(me)c
-142.571(<mailto:[email protected]>)c
-276.936(with)c
-299.244(your)c
-322.157(questions.)c
+142.571(<[email protected]>)c
+245.762(with)c
+268.070(your)c
+290.983(questions.)c
f1
76.274 179.762(URIs)s
103.466(with)c
@@ -292,7 +292,7 @@
f0
87.274 687.599(like)s
106.524([email protected])c
-230.296(<mailto:[email protected]>)c
+230.296(<[email protected]>)c
f0
68.024 739.233(\(\))s
536.932(\(\))c
Modified: trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8
===================================================================
--- trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8 2025-04-03 19:35:04 UTC (rev 10074)
+++ trunk/sandbox/manpage-writer/expected-mandoc/refs-urue.utf8 2025-04-06 16:49:55 UTC (rev 10075)
@@ -76,7 +76,7 @@
aanndd
See the Python <https://www.python.org/> home page for info.
- Write to me <mailto:[email protected]> with your questions.
+ Write to me <[email protected]> with your questions.
UURRIIss wwiitthh kknnoowwnn sscchheemmeess
tel:+48-816-555-1212 <tel:+48-816-555-1212> urn:isbn:0-486-27557-4
@@ -86,6 +86,6 @@
<https://[email protected]:123/forum/questions/?tag=networking&order=newest#top>
SSttaannddaalloonnee eemmaaiill aaddddrreesssseess
- like [email protected] <mailto:[email protected]>
+ like [email protected] <[email protected]>
()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
_______________________________________________
Docutils-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-checkins