Render author email addresses in markdown BIPs #1759

pull murchandamus wants to merge 1 commits into bitcoin:master from murchandamus:render-email-in-.md changing 4 files +17 −8
  1. murchandamus commented at 3:59 pm on February 7, 2025: contributor
    @ajtowns pointed out in his [BIP 3 review]( #1712 (review)) that the author email addresses in the preamble of BIPs in markdown format were not being rendered.
  2. murchandamus commented at 4:24 pm on February 7, 2025: contributor
    Alas, the formatting checker doesn’t accept this change. It looks like we will need to adjust the formatting requirements so we can have the email addresses in the markdown file preamble rendered.
  3. Use code block instead of pre for markdown 726df6f4d5
  4. ajtowns commented at 10:09 am on February 8, 2025: contributor
  5. katesalazar commented at 12:08 pm on February 9, 2025: contributor
    https://github.com/ajtowns/bips/commit/726df6f4d54c7c7f9f1856ab37d07ece5defa0eb dunno if it is more Markdown-idiomatic, but is more elegant for reading the raw document source.
  6. katesalazar commented at 12:12 pm on February 9, 2025: contributor

    From the Daring Fireball Introducing Markdown post

    Markdown allows web writers to compose text using a simple, readable, plain text formatting syntax

    (emphasis in “readable” is mine)

  7. murchandamus force-pushed on Feb 10, 2025
  8. murchandamus commented at 5:28 pm on February 10, 2025: contributor
    @ajtowns: Thanks, that looks great. I’ve used your commit instead of mine.
  9. in scripts/buildtable.pl:111 in 726df6f4d5
    107+	if ($is_markdown) {
    108+		while (<$F> !~ m[^(?:\xef\xbb\xbf)?```$]) {
    109+			die "No ``` in $fn" if eof $F;
    110+		}
    111+	} else {
    112+		while (<$F> !~ m[^(?:\xef\xbb\xbf)?<pre>$]) {
    


    murchandamus commented at 5:32 pm on February 10, 2025:
    This appears to be Perl for reading a file line by line, and requiring that the initial lines of the file either only contain the byte order mark, or ``` if it is a Markdown file or <pre> if it is a Mediawiki file.

    ajtowns commented at 8:11 am on February 11, 2025:
    It reads the next (first) line of the file, checks if the full line doesn’t exactly match <pre> possibly preceded by the byte order marker, and aborts if it doesn’t. Not sure why it’s written as a while loop; it’s not like it can actually enter the loop body twice.
  10. in scripts/buildtable.pl:120 in 726df6f4d5
    117 	my ($title, $author, $status, $type, $layer);
    118 	my ($field, $val);
    119 	while (<$F>) {
    120-		m[^</pre>$] && last;
    121+		last if ($is_markdown && m[^```$]);
    122+		last if (!$is_markdown && m[^</pre>$]);
    


    murchandamus commented at 5:33 pm on February 10, 2025:
    In Perl, a while loop can be terminated by calling last, so this ends the while loop that is reading the preamble.
  11. murchandamus commented at 5:34 pm on February 10, 2025: contributor
    LGTM. I think it’s RFM. @jonatack?
  12. jonatack commented at 8:20 pm on February 10, 2025: member

    Review ACK 726df6f4d54c7c7f9f1856ab37d07ece5defa0eb

    Thanks @ajtowns for spotting this and the patch.

    Verified that all the BIPs in markdown format have been updated.

    0$ ls *.md  
    1CONTRIBUTING.md bip-0348.md     bip-0349.md     bip-0379.md
    
  13. jonatack merged this on Feb 10, 2025
  14. jonatack closed this on Feb 10, 2025

  15. jonatack added the label Bug fix on Feb 10, 2025
  16. murchandamus deleted the branch on Feb 12, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-02-22 08:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me