1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-02-21 14:34:51 +01:00

Use code block instead of pre for markdown

This commit is contained in:
Anthony Towns 2025-02-08 20:04:18 +10:00
parent ea7aae8d1f
commit 726df6f4d5
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";
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;
}
}
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;