openedx / edx-platform

The Open edX LMS & Studio, powering education sites around the world!
https://openedx.org
GNU Affero General Public License v3.0
7.44k stars 3.88k forks source link

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

Open bradenmacdonald opened 4 hours ago

bradenmacdonald commented 4 hours ago
  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:

https://github.com/openedx/edx-platform/blob/3e43e33eff7038183c4088fe29209ddcb37ab47e/common/djangoapps/static_replace/__init__.py#L116-L119

Screenshot 2024-11-14 at 1 10 44 PM

bradenmacdonald commented 4 hours ago

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