Skip to content

Commit ff9d4c5

Browse files
fix: direct static file is fixed
1 parent a15ea7c commit ff9d4c5

File tree

1 file changed

+2
-2
lines changed
  • src/editors/sharedComponents/TinyMceWidget

1 file changed

+2
-2
lines changed

src/editors/sharedComponents/TinyMceWidget/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ export const replaceStaticWithAsset = ({
124124

125125
// Check if this is a direct /static/filename.ext pattern (should be converted)
126126
// vs /static/images/filename.ext pattern (should NOT be converted)
127-
const isDirectStaticFile = isStatic && !assetSrc.substring(8).includes('images/');
127+
const isDirectStaticFile = (isStatic || assetSrc.startsWith('/asset')) && !assetSrc.substring(8).includes('images/');
128128

129129
const staticName = assetSrc.substring(8);
130130
const assetName = parseAssetName(src);
131131
const displayName = isStatic ? staticName : assetName;
132-
const isCorrectAssetFormat = assetSrc.startsWith('/asset') && assetSrc.match(/\/asset-v1:\S+[+]\S+[@]\S+[+]\S+[@]/g)?.length >= 1;
132+
const isCorrectAssetFormat = assetSrc.match(/\/asset-v1:\S+[+]\S+[@]\S+[+]\S+[@]/g)?.length >= 1;
133133

134134
// assets in expandable text areas do not support relative urls so all assets must have the lms
135135
// endpoint prepended to the relative url

0 commit comments

Comments
 (0)