[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: Make .Lk with more than two arguments spec conform
From: |
Carsten Kunze |
Subject: |
[groff] 01/01: Make .Lk with more than two arguments spec conform |
Date: |
Thu, 13 Apr 2017 16:40:59 -0400 (EDT) |
carstenkunze pushed a commit to branch master
in repository groff.
commit 24904c378090cdb17f8e2390829ad41b7fee3ec0
Author: Ingo Schwarze <address@hidden>
Date: Thu Apr 13 22:39:28 2017 +0200
Make .Lk with more than two arguments spec conform
See https://savannah.gnu.org/bugs/?50789
---
ChangeLog | 16 ++++++++++++++++
tmac/doc.tmac-u | 56 ++++++++++++++++++++++++++++++++++++--------------------
2 files changed, 52 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3a54074..3533092 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2017-04-13 Ingo Schwarze <address@hidden>
+
+ * tmac/doc.tmac-u: Make .Lk with more than two arguments
+ mdoc(7) conform
+
+ Use the second and following arguments as the link text.
+
+ Do not mark up the following colon with \fI.
+
+ Handle any number of trailing delimiters.
+
+ Problem reported by Anthony Bentley <address@hidden>,
+ fixed by Ingo Schwarze <address@hidden>.
+
+ https://savannah.gnu.org/bugs/?50789
+
2017-04-12 Werner LEMBERG <address@hidden>
Update German hyphenation patterns.
diff --git a/tmac/doc.tmac-u b/tmac/doc.tmac-u
index 71c6846..8b7ad4c 100644
--- a/tmac/doc.tmac-u
+++ b/tmac/doc.tmac-u
@@ -6447,37 +6447,53 @@
.\" NS link (for conversion to HTML)
.\" NS
.\" NS local variables:
+.\" NS doc-delim-Lk
.\" NS doc-reg-Lk
-.\" NS doc-str-Lk
+.\" NS doc-target-Lk
+.\" NS doc-text-Lk
.
.de Lk
-. ds doc-str-Lk Sy \$@
-.
-. ie (\n[.$] > 1) \{\
-. doc-get-width "\$2"
-. doc-get-arg-type \$2
-. ie (\n[doc-arg-type] < 3) \{\
-. Em \)\$2:
-. ds doc-str-Lk Sy "\$1"
-. doc-get-width "\$1"
-. shift 2
-. if \n[.$] \
-. as doc-str-Lk " \$@
+. \" The first argument is the target URI.
+. ds doc-target-Lk \$1
+. shift
+.
+. \" Split the remaining arguments into link text and delimiters.
+. ds doc-text-Lk
+. ds doc-delim-Lk
+. while \n[.$] \{\
+. doc-get-width "\$1"
+. doc-get-arg-type \$1
+. ie (\n[doc-arg-type] > 2) \
+. as doc-delim-Lk \$1
+. el \{\
+. if !'\*[doc-delim-Lk]'' \{\
+. \" More text follows delimiter(s); go back to text mode.
+. as doc-text-Lk \*[doc-delim-Lk]
+. ds doc-delim-Lk
+. \}
+. ie '\*[doc-text-Lk]'' \
+. ds doc-text-Lk \$1
+. el \
+. as doc-text-Lk " \$1
. \}
-. el \
-. doc-get-width "\$1"
+. shift
. \}
-. el \
-. doc-get-width "\$1"
.
+. \" Print the link text, if any.
+. if !'\*[doc-text-Lk]'' \
+. Em \*[doc-text-Lk] Ns :
+.
+. \" Print the link target.
. ie n \
. nr doc-reg-Lk 26
. el \
. nr doc-reg-Lk 38
+. doc-get-width "\*[doc-target-Lk]"
. ie (\n[doc-width] >= \n[doc-reg-Lk]) \
-. D1 \*[doc-str-Lk]
-. el \
-. \*[doc-str-Lk]
+. D1 Sy \*[doc-target-Lk] Ns \*[doc-delim-Lk]\&
+. el .ie \n[doc-width] \
+. Sy \*[doc-target-Lk] Ns \*[doc-delim-Lk]\&
+. el \*[doc-delim-Lk]\&
..
.
.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: Make .Lk with more than two arguments spec conform,
Carsten Kunze <=