Skip to content

Commit 61e14df

Browse files
committed
Prevent linkification of URL in error message
GitHub Flavored Markdown automatically linkifies URLs and web addresses. A link is a "click me" signal to the reader. In this case, there is no reason for the reader to visit the web address. The error message is only displaying it to make it clear what is being referred to. So the linkification actually has a harmful effect on readability and might sidetrack the reader.
1 parent 91f8639 commit 61e14df

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func populateSubmission(submissionURL string, listPath *paths.Path) (submissionT
260260

261261
// Check if URL is from a supported Git host.
262262
if !uRLIsUnder(normalizedURLObject, supportedHosts) {
263-
submission.Error = normalizedURLObject.Host + " is not currently supported as a Git hosting website for Library Manager.%0A%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for-a-library-to-be-added-to-library-manager"
263+
submission.Error = fmt.Sprintf("`%s` is not currently supported as a Git hosting website for Library Manager.%%0A%%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for-a-library-to-be-added-to-library-manager", normalizedURLObject.Host)
264264
return submission, ""
265265
}
266266

test/test_all.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"name": "",
9191
"official": False,
9292
"tag": "",
93-
"error": "example.com is not currently supported as a Git hosting website for Library Manager.%0A"
93+
"error": "`example.com` is not currently supported as a Git hosting website for Library Manager.%0A"
9494
"%0ASee: https://github.com/arduino/library-registry/blob/main/FAQ.md#what-are-the-requirements-for"
9595
"-a-library-to-be-added-to-library-manager",
9696
}

0 commit comments

Comments
 (0)