Fix broken anchor links in BIP 0342, BIP 0022, BIP 0023#2091
Fix broken anchor links in BIP 0342, BIP 0022, BIP 0023#2091EthanHeilman wants to merge 6 commits intobitcoin:masterfrom
Conversation
|
I was able to verify the issue (original links are broken, new link works in the edited file). Will follow-up in the following days. |
murchandamus
left a comment
There was a problem hiding this comment.
On a second look, I agree that some of the existing links were broken, but I propose a different approach to sanitizing them.
| We define the tapscript message extension ''ext'' to [[bip-0341.mediawiki#common-signature-message|BIP341 Common Signature Message]], indicated by ''ext_flag = 1'': | ||
| * ''tapleaf_hash'' (32): the tapleaf hash as defined in [[bip-0341.mediawiki#design|BIP341]] |
There was a problem hiding this comment.
The two existing links here appear to work fine for me, as does the one in line 116.
bip-0022.mediawiki
Outdated
| A JSON-RPC method is defined, called "getblocktemplate". | ||
| It accepts exactly one argument, which MUST be an Object of request parameters. | ||
| If the request parameters include a "mode" key, that is used to explicitly select between the default "template" request or a [[bip-0023.mediawiki#Block Proposal|"proposal"]]. | ||
| If the request parameters include a "mode" key, that is used to explicitly select between the default "template" request or a [[bip-0023.mediawiki#user-content-Block_Proposal|"proposal"]]. |
There was a problem hiding this comment.
Looking a bit more into this, I think there is a better way.
Inserting user-content- before the anchor into link [[bip-0023.mediawiki#user-content-Block_Proposal|"bla"]] actually causes the link to open too low in the page for me (either on Firefox and Brave).
When the link is sanitized by lowercasing all words and replacing spaces with hyphens instead, [[bip-0023.mediawiki#block-proposal|"bla"]], it jumps to the right spot just above the targeted header.
Therefore, I would suggest to sanitze the links instead as follows:
| If the request parameters include a "mode" key, that is used to explicitly select between the default "template" request or a [[bip-0023.mediawiki#user-content-Block_Proposal|"proposal"]]. | |
| If the request parameters include a "mode" key, that is used to explicitly select between the default "template" request or a [[bip-0023.mediawiki#block-proposal|"proposal"]]. |
bip-0022.mediawiki
Outdated
| ! Key !! Required !! Type !! Description | ||
| |- | ||
| | capabilities || No || Array of Strings || SHOULD contain a list of the following, to indicate client-side support: [[#Optional: Long Polling|"longpoll"]], "coinbasetxn", "coinbasevalue", [[bip-0023.mediawiki#Block Proposal|"proposal"]], [[bip-0023.mediawiki#Logical Services|"serverlist"]], "workid", and any of the [[bip-0023.mediawiki#Mutations|mutations]] | ||
| | capabilities || No || Array of Strings || SHOULD contain a list of the following, to indicate client-side support: [[#Optional: Long Polling|"longpoll"]], "coinbasetxn", "coinbasevalue", [[bip-0023.mediawiki#user-content-Block_Proposal|"proposal"]], [[bip-0023.mediawiki#user-content-Logical_Services|"serverlist"]], "workid", and any of the [[bip-0023.mediawiki#user-content-Mutations|mutations]] |
There was a problem hiding this comment.
| | capabilities || No || Array of Strings || SHOULD contain a list of the following, to indicate client-side support: [[#Optional: Long Polling|"longpoll"]], "coinbasetxn", "coinbasevalue", [[bip-0023.mediawiki#user-content-Block_Proposal|"proposal"]], [[bip-0023.mediawiki#user-content-Logical_Services|"serverlist"]], "workid", and any of the [[bip-0023.mediawiki#user-content-Mutations|mutations]] | |
| | capabilities || No || Array of Strings || SHOULD contain a list of the following, to indicate client-side support: [[#Optional: Long Polling|"longpoll"]], "coinbasetxn", "coinbasevalue", [[bip-0023.mediawiki#block-proposal|"proposal"]], [[bip-0023.mediawiki#logical-services|"serverlist"]], "workid", and any of the [[bip-0023.mediawiki#mutations|mutations]] |
There was a problem hiding this comment.
Could you please also fix the anchors below in the same document on line 58-68?
bip-0023.mediawiki
Outdated
| * [[bip-0022.mediawiki#user-content-Optional_Long_Polling|BIP 22 Long Polling]] | ||
| * [[#user-content-Basic_Pool_Extensions|BIP 23 Basic Pool Extensions]] | ||
| * [[#user-content-Mutations|BIP 23 Mutation "coinbase/append"]] | ||
| * [[#user-content-Submission_Abbreviation|BIP 23 Submission Abbreviation "submit/coinbase"]] | ||
| * [[#user-content-Mutations|BIP 23 Mutation "time/increment"]] (only required for servers) |
There was a problem hiding this comment.
| * [[bip-0022.mediawiki#user-content-Optional_Long_Polling|BIP 22 Long Polling]] | |
| * [[#user-content-Basic_Pool_Extensions|BIP 23 Basic Pool Extensions]] | |
| * [[#user-content-Mutations|BIP 23 Mutation "coinbase/append"]] | |
| * [[#user-content-Submission_Abbreviation|BIP 23 Submission Abbreviation "submit/coinbase"]] | |
| * [[#user-content-Mutations|BIP 23 Mutation "time/increment"]] (only required for servers) | |
| * [[bip-0022.mediawiki#optional-long-polling|BIP 22 Long Polling]] | |
| * [[#basic-pool-extensions|BIP 23 Basic Pool Extensions]] | |
| * [[#mutations|BIP 23 Mutation "coinbase/append"]] | |
| * [[#submission-abbreviation|BIP 23 Submission Abbreviation "submit/coinbase"]] | |
| * [[#mutations|BIP 23 Mutation "time/increment"]] (only required for servers) |
bip-0023.mediawiki
Outdated
| * [[#user-content-Mutations|BIP 23 Mutation "transactions/add"]] | ||
| * [[#user-content-Block_Proposals|BIP 23 Block Proposals]] |
There was a problem hiding this comment.
| * [[#user-content-Mutations|BIP 23 Mutation "transactions/add"]] | |
| * [[#user-content-Block_Proposals|BIP 23 Block Proposals]] | |
| * [[#mutations|BIP 23 Mutation "transactions/add"]] | |
| * [[#block-proposals|BIP 23 Block Proposals]] |
bip-0023.mediawiki
Outdated
| If it is found to be in violation of any of these rules, the server MUST return one of the following: | ||
| * Null if it is acceptable as-is, with the same workid (if any) as provided. Note that this SHOULD NOT invalidate the old template's claim to the same workid. | ||
| * A String giving the reason for the rejection (see [[bip-0022.mediawiki#appendix-example-rejection-reasons|example rejection reasons]]). | ||
| * A String giving the reason for the rejection (see [[bip-0022.mediawiki#user-content-appendix-example-rejection-reasons|example rejection reasons]]). |
There was a problem hiding this comment.
The original works here for me.
| * A String giving the reason for the rejection (see [[bip-0022.mediawiki#user-content-appendix-example-rejection-reasons|example rejection reasons]]). | |
| * A String giving the reason for the rejection (see [[bip-0022.mediawiki#appendix-example-rejection-reasons|example rejection reasons]]). |
bip-0342.mediawiki
Outdated
| * It is a '''taproot spend''' as defined in [[bip-0341.mediawiki#user-content-design|BIP341]] (i.e., the witness version is 1, the witness program is 32 bytes, and it is not P2SH wrapped). | ||
| * It is a '''script path spend''' as defined in [[bip-0341.mediawiki#user-content-design|BIP341]] (i.e., after removing the optional annex from the witness stack, two or more stack elements remain). |
Used the following `sed` command and manually verified the unstaged changes. Special cases that were not committed included external links to Wikipedia which are case-sensitive, links specific lines in code, a link to a title with a slash that had to be cleaned up, and links to citations on the BIP repository that contain an underscore. ``` sed -E -i ' s/(\[\[[^][]*#)([^]|]*)(\||\]\])/\1\L\2\E\3/g :again s/(\[\[[^][]*#)([^]|]*)([: _]+)([^]|]*)(\||\]\])/\1\2-\4\5/g t again ' bip-0*mediawiki ```
murchandamus
left a comment
There was a problem hiding this comment.
Since this had been dormant for a bit, I took the liberty to apply the proposed changes and to address the remaining anchors that used the broken format or relied on user-content-.
a725202 to
6899bf4
Compare
At some point github changed how anchor links work. Currently anchor links using the double square bracket format require that the anchor be prepended with
user-content-.This means that the following link used to work, but doesn't today
The link that works today would be
The link still resolves to the page, but just not the anchor so I suspect no one noticed.
In addition to this it appears that in the past github anchors could have spaces or punction, but that is no longer valid. Spaces are replaced with
_and punction appears to be not included in the anchor.I fixed this for BIP 0342, BIP 0022, BIP 0023, but it impacts a good chunk of BIPs. If you want I can change this PR to fix for all the BIPs, but I didn't want to put in the time to do that in case an editor wanted to make these changes themselves.
If this PR isn't useful or the project isn't interested in fixing this very minor linking issue. Feel free to close this PR.