Skip to content
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

[CleanRepo]: Images for image hyperlinks flagged as orphans #396

Open
wadepickett opened this issue Aug 20, 2024 · 1 comment
Open

[CleanRepo]: Images for image hyperlinks flagged as orphans #396

wadepickett opened this issue Aug 20, 2024 · 1 comment
Assignees

Comments

@wadepickett
Copy link

wadepickett commented Aug 20, 2024

Clean Repo seems to be flagging images incorrectly as orphaned for image hyperlinks. The image used to display for the image hyperlink is fine but in the case of an image hyperlink, the resulting image the hyperlink retrieves on a click is determined to be orphaned in the report.

Severity:
In the old aspnetdocs repo we had over 3000 image hyperlinks which Clean Repo flagged incorrectly as orphaned. However, I don't think image hyperlinks are used as much like this in other repos,

It used to be years ago, that two images were provided for screenshot image hyperlinks for our docs. One larger and one smaller and the smaller one was used as the link itself. Clicking on the screenshot or whatever the image was of, resulted in a larger version of the image being retrieved and displayed.

Recreating the issue:

  • Run the latest version of Clean Repo available today 8/20/24 in release mode.
  • Run the option for orphaned images:
    CleanRepo.exe --orphaned-images
  • Provide the details for a local cloned copy of the aspnetdocs repo.
  • Specify to not delete the images to get the report of orphaned images that incorrectly includes images referred to by image hyperlinks. (Also choosing to delete images results in incorrectly deleting images that should not be deleted.)

Results:
The list of images returned as orphaned will include the image from the image link used for the full image that is returned when the link is clicked.

Example:
In a link like the following, external-authentication-services/_static/image25.png would be determined incorrectly to be orphaned:
[![Image displaying default Facebook home page](external-authentication-services/_static/image26.png "Click to Expand the Image")](external-authentication-services/_static/image25.png)

This example image link can be found in this .md article example [here].https://raw.githubusercontent.com/dotnet/AspNetDocs/main/aspnet/web-api/overview/security/external-authentication-services.md)

It does not matter if tooltip text exists in the hyperlink or not. Same incorrect results.

Some helpful regex that could be used to find these cases:
In case you were interested here is regex I used to find examples of image hyperlinks with or without tooltip text in them:

Find image hyperlinks with tooltip text not in them:
\[!\[.*?\]\(.*?\)\]\(.*?\)

Find image hyperlinks with tooltip text in them:
\[!\[.*?".*?"\)\]\(.*?\)

@wadepickett
Copy link
Author

@gewarren FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants