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

Library XBlocks cannot reference assets named "xblock*" #35853

Open
bradenmacdonald opened this issue Nov 14, 2024 · 1 comment
Open

Library XBlocks cannot reference assets named "xblock*" #35853

bradenmacdonald opened this issue Nov 14, 2024 · 1 comment
Assignees
Labels
bug Report of or fix for something that isn't working as intended

Comments

@bradenmacdonald
Copy link
Contributor

  1. Upload an image named xblock-something.png to a Text component in a v2 content library.
  2. Reference that image in the HTML, as <img src="/static/xblock-something.png" />
  3. The image will not display in the preview, due to this code:

starts_with_prefix = full_url.startswith(XBLOCK_STATIC_RESOURCE_PREFIX)
contains_prefix = XBLOCK_STATIC_RESOURCE_PREFIX in full_url
if starts_with_prefix or (starts_with_static_url and contains_prefix):
return original

Screenshot 2024-11-14 at 1 10 44 PM

@bradenmacdonald bradenmacdonald added the bug Report of or fix for something that isn't working as intended label Nov 14, 2024
@bradenmacdonald bradenmacdonald changed the title Library XBlocks cannot reference assets named "xblock-*" Library XBlocks cannot reference assets named "xblock*" Nov 14, 2024
@bradenmacdonald
Copy link
Contributor Author

I suspect a simple fix for this is only ignoring URLs that start with /static/xblock/ rather than /static/xblock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Report of or fix for something that isn't working as intended
Projects
None yet
Development

No branches or pull requests

2 participants