Use the 'label' to update definitions (#36808)

This commit is contained in:
Peter Bengtsson 2023-05-03 14:13:16 -04:00 коммит произвёл GitHub
Родитель 8dcea22cd7
Коммит 1270c7dbe9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -175,11 +175,11 @@ You can always rely on [GitHub integrations][integrations].
[status API]: /rest/commits/statuses
[ngrok]: https://ngrok.com/
[using ngrok]: /webhooks/configuring/#using-ngrok
[using ngrok]: /webhooks-and-events/webhooks/configuring-your-server-to-receive-payloads#using-ngrok
[platform samples]: https://github.com/github/platform-samples/tree/master/api/ruby/building-a-ci-server
[Sinatra]: http://www.sinatrarb.com/
[octokit.rb]: https://github.com/octokit/octokit.rb
[access token]: /articles/creating-an-access-token-for-command-line-use
[access token]: /authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
[travis api]: https://api.travis-ci.com/docs/
[janky]: https://github.com/github/janky
[integrations]: https://github.com/integrations

Просмотреть файл

@ -169,14 +169,14 @@ async function updateFile(file, context, opts) {
if (content.includes(asMarkdown)) {
if (opts.fixHref) {
let newHref = node.url
const { identifier } = node
const { label } = node
const betterHref = getNewHref(newHref, context, opts, file)
// getNewHref() might return a deliberate `undefined` if the
// new href value could not be computed for some reason.
if (betterHref !== undefined) {
newHref = betterHref
}
const newAsMarkdown = `[${identifier}]: ${newHref}`
const newAsMarkdown = `[${label}]: ${newHref}`
if (asMarkdown !== newAsMarkdown) {
// Something can be improved!
const column = node.position.start.column