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

The image flaw check function can not correctly handle the raw non-uri-encoded image src #10859

Open
3 tasks done
yin1999 opened this issue Apr 6, 2024 · 1 comment
Open
3 tasks done
Labels
idle needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@yin1999
Copy link
Member

yin1999 commented Apr 6, 2024

Summary

The image flaw check function will use the uri-encoded src value to check whether the characters in the value are completely lowercase, and use the uri-encoded src value to match the image type node. But in mdn/content, there is non-encoded URIs, which may cause the above check/match to fail. See:

https://github.com/mdn/content/blob/9657c42cc4f2afff708df107a92838a3dec8514c/files/en-us/glossary/bezier_curve/index.md?plain=1#L15

Related testing file: testing/content/files/en-us/glossary/bézier_curve/index.html

URL

http://localhost:5042/en-US/docs/Glossary/Bezier_curve

Reproduction steps

  1. Run yarn start in mdn/content
  2. Go to http://localhost:5042/en-US/docs/Glossary/Bezier_curve
  3. Check the logs in terminal, we will see: "Could not find enough matches for src: b%C3%A9zier_2_big.gif, index 0 out of bounds"

screenshot_2024-04-06_21-13-58

Expected behavior

Correctly handle this.

Actual behavior

The function can not handle this, and log the warning message.

Device

Desktop

Browser

Chrome

Browser version

Stable

Operating system

Android

Screenshot

No response

Anything else?

No response

Validations

@github-actions github-actions bot added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Apr 6, 2024
@yin1999
Copy link
Member Author

yin1999 commented Apr 6, 2024

I'm not sure whether it's a better idea to restrict local image file names to only contain ascii characters. I have only found the above case so far.

@github-actions github-actions bot added the idle label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant