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

fix: asset name parsing in static converter #501

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

KristinAoki
Copy link
Member

Description

This PR fixes images not loading in the visual text and problem editor. When assets were loaded with asset-v1:org+number+run+type@asset+block/image_name.png asset format, it would incorrectly parse to asset-v1:org+number+run+type@asset+block/asset-v1:org+number+run+type@asset+block@image_name.png. A similar issue was fixed in #497. The same src parser is now used for replaceStaticWithAsset as was added for setAssetToStaticUrl.

Testing

  1. Open an html block
  2. Add an image
  3. Click the "HTML" button in the toolbar
  4. Replace the second "@" with "/"
  5. Click "Save"
  6. Confirm that the image is still visible

@KristinAoki KristinAoki requested a review from rayzhou-bit August 6, 2024 17:02
Copy link

codecov bot commented Aug 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.92%. Comparing base (b68257e) to head (3e89706).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #501   +/-   ##
=======================================
  Coverage   88.91%   88.92%           
=======================================
  Files         248      248           
  Lines        4554     4558    +4     
  Branches      943      944    +1     
=======================================
+ Hits         4049     4053    +4     
  Misses        472      472           
  Partials       33       33           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristinAoki KristinAoki enabled auto-merge (squash) August 6, 2024 18:03
Copy link
Contributor

@rayzhou-bit rayzhou-bit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@KristinAoki KristinAoki merged commit b088a8f into main Aug 9, 2024
8 checks passed
@KristinAoki KristinAoki deleted the KristinAoki/fix-asset-url-conversion-on-load branch August 9, 2024 17:02
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

Successfully merging this pull request may close these issues.

2 participants