1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-02-22 15:04:46 +01:00

Merge pull request #1759 from murchandamus/render-email-in-.md

Render author email addresses in markdown BIPs
This commit is contained in:
Jon Atack 2025-02-10 12:22:31 -08:00 committed by GitHub
commit 3c7b0d6498
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 17 additions and 8 deletions

View file

@ -1,4 +1,4 @@
<pre> ```
BIP: 348 BIP: 348
Layer: Consensus (soft fork) Layer: Consensus (soft fork)
Title: CHECKSIGFROMSTACK Title: CHECKSIGFROMSTACK
@ -9,7 +9,7 @@
Type: Standards Track Type: Standards Track
Created: 2024-11-26 Created: 2024-11-26
License: BSD-3-Clause License: BSD-3-Clause
</pre> ```
## Abstract ## Abstract

View file

@ -1,4 +1,4 @@
<pre> ```
BIP: 349 BIP: 349
Layer: Consensus (soft fork) Layer: Consensus (soft fork)
Title: OP_INTERNALKEY Title: OP_INTERNALKEY
@ -9,7 +9,7 @@
Type: Standards Track Type: Standards Track
Created: 2024-11-14 Created: 2024-11-14
License: BSD-3-Clause License: BSD-3-Clause
</pre> ```
## Abstract ## Abstract

View file

@ -1,4 +1,4 @@
<pre> ```
BIP: 379 BIP: 379
Layer: Applications Layer: Applications
Title: Miniscript Title: Miniscript
@ -13,7 +13,7 @@
Type: Informational Type: Informational
Created: 2023-10-10 Created: 2023-10-10
License: CC0-1.0 License: CC0-1.0
</pre> ```
## Abstract ## Abstract

View file

@ -96,19 +96,28 @@ my %emails;
my $bipnum = 0; my $bipnum = 0;
while (++$bipnum <= $topbip) { while (++$bipnum <= $topbip) {
my $fn = sprintf "bip-%04d.mediawiki", $bipnum; my $fn = sprintf "bip-%04d.mediawiki", $bipnum;
my $is_markdown = 0;
if (!-e $fn) { if (!-e $fn) {
$fn = sprintf "bip-%04d.md", $bipnum; $fn = sprintf "bip-%04d.md", $bipnum;
$is_markdown = 1;
} }
-e $fn || next; -e $fn || next;
open my $F, "<$fn"; open my $F, "<$fn";
while (<$F> !~ m[^(?:\xef\xbb\xbf)?<pre>$]) { if ($is_markdown) {
while (<$F> !~ m[^(?:\xef\xbb\xbf)?```$]) {
die "No ``` in $fn" if eof $F;
}
} else {
while (<$F> !~ m[^(?:\xef\xbb\xbf)?<pre>$]) {
die "No <pre> in $fn" if eof $F; die "No <pre> in $fn" if eof $F;
}
} }
my %found; my %found;
my ($title, $author, $status, $type, $layer); my ($title, $author, $status, $type, $layer);
my ($field, $val); my ($field, $val);
while (<$F>) { while (<$F>) {
m[^</pre>$] && last; last if ($is_markdown && m[^```$]);
last if (!$is_markdown && m[^</pre>$]);
if (m[^ ([\w-]+)\: (.*\S)$]) { if (m[^ ([\w-]+)\: (.*\S)$]) {
$field = $1; $field = $1;
$val = $2; $val = $2;