summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-02-16 20:03:35 -0500
committerJune McEnroe <june@causal.agency>2021-02-16 20:03:35 -0500
commitefe48b5c8eb811e0764808428415d6e08fa8ed39 (patch)
tree1259a8088b5805c3f1435f3da055ed5282b79511
parentSet XTerm*charClass to select URLs (diff)
downloadsrc-efe48b5c8eb811e0764808428415d6e08fa8ed39.tar.gz
src-efe48b5c8eb811e0764808428415d6e08fa8ed39.zip
Add missing %U for RFCs in bibsort
-rw-r--r--bin/bibsort.pl6
-rw-r--r--bin/man1/bibsort.17
2 files changed, 9 insertions, 4 deletions
diff --git a/bin/bibsort.pl b/bin/bibsort.pl
index f87f066f..89133c87 100644
--- a/bin/bibsort.pl
+++ b/bin/bibsort.pl
@@ -32,11 +32,13 @@ sub byLast {
 foreach $ref (@refs) {
 	@{$ref->{A}} = sort byLast @{$ref->{A}};
 	@{$ref->{Q}} = sort @{$ref->{Q}} if $ref->{Q};
-	next unless $ref->{N};
-	if ($ref->{N}[0] =~ /RFC/) {
+	if ($ref->{N} && $ref->{N}[0] =~ /RFC/) {
 		$ref->{R} = $ref->{N};
 		delete $ref->{N};
 	}
+	if ($ref->{R} && $ref->{R}[0] =~ /RFC (\d+)/ && !$ref->{U}) {
+		$ref->{U} = ["https://tools.ietf.org/html/rfc${1}"];
+	}
 }
 
 sub byAuthor {
diff --git a/bin/man1/bibsort.1 b/bin/man1/bibsort.1
index 9d036920..07ed91ef 100644
--- a/bin/man1/bibsort.1
+++ b/bin/man1/bibsort.1
@@ -1,4 +1,4 @@
-.Dd December 15, 2020
+.Dd February 16, 2021
 .Dt BIBSORT 1
 .Os
 .
@@ -31,7 +31,10 @@ Additionally,
 macros referencing RFC numbers
 are rewritten to
 .Ic \&%R
-macros.
+macros
+and missing
+.Ic \&%U
+macros are added for RFCs.
 .
 .Sh EXAMPLES
 .Dl :%!bibsort