Skip to content

Render author email addresses in markdown BIPs #1759

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

murchandamus
Copy link
Contributor

@murchandamus murchandamus commented Feb 7, 2025

@ajtowns pointed out in his BIP 3 review that the author email addresses in the preamble of BIPs in markdown format were not being rendered.

@murchandamus
Copy link
Contributor Author

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.

@ajtowns
Copy link
Contributor

ajtowns commented Feb 8, 2025

I'd suggest ajtowns@726df6f

@katesalazar
Copy link
Contributor

ajtowns@726df6f dunno if it is more Markdown-idiomatic, but is more elegant for reading the raw document source.

@katesalazar
Copy link
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)

@murchandamus
Copy link
Contributor Author

@ajtowns: Thanks, that looks great. I’ve used your commit instead of mine.

Copy link
Contributor Author

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think it’s RFM. @jonatack?

Comment on lines +107 to +111
while (<$F> !~ m[^(?:\xef\xbb\xbf)?```$]) {
die "No ``` in $fn" if eof $F;
}
} else {
while (<$F> !~ m[^(?:\xef\xbb\xbf)?<pre>$]) {
Copy link
Contributor Author

@murchandamus murchandamus Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +119 to +120
last if ($is_markdown && m[^```$]);
last if (!$is_markdown && m[^</pre>$]);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Perl, a while loop can be terminated by calling last, so this ends the while loop that is reading the preamble.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review ACK 726df6f

Thanks @ajtowns for spotting this and the patch.

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

$ ls *.md  
CONTRIBUTING.md bip-0348.md     bip-0349.md     bip-0379.md

@jonatack jonatack merged commit 3c7b0d6 into bitcoin:master Feb 10, 2025
4 checks passed
@murchandamus murchandamus deleted the render-email-in-.md branch February 12, 2025 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants