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

View file

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

View file

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

View file

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