Skip to content

Commit

Permalink
fix: Attachment - A broken video file is loaded via action menu.
Browse files Browse the repository at this point in the history
Signed-off-by: krishna2323 <[email protected]>
  • Loading branch information
Krishna2323 committed Aug 2, 2024
1 parent 73f97c9 commit f82422b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/fileDownload/getAttachmentDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const getAttachmentDetails: GetAttachmentDetails = (html) => {
const IS_IMAGE_TAG = /<img([\w\W]+?)\/>/i.test(html);
const PREVIEW_SOURCE_REGEX = new RegExp(`${CONST.ATTACHMENT_PREVIEW_ATTRIBUTE}*=*"(.+?)"`, 'i');
const SOURCE_REGEX = new RegExp(`${CONST.ATTACHMENT_SOURCE_ATTRIBUTE}*=*"(.+?)"`, 'i');
const ORIGINAL_FILENAME_REGEX = IS_IMAGE_TAG ? new RegExp(`${CONST.ATTACHMENT_ORIGINAL_FILENAME_ATTRIBUTE}*=*"(.+?)"`, 'i') : new RegExp('<a[^>]*>([^<]+)</a>', 'i');
const ORIGINAL_FILENAME_REGEX = IS_IMAGE_TAG ? new RegExp(`${CONST.ATTACHMENT_ORIGINAL_FILENAME_ATTRIBUTE}*=*"(.+?)"`, 'i') : new RegExp('<(?:a|video)[^>]*>([^<]+)</(?:a|video)>', 'i');
if (!html) {
return {
previewSourceURL: null,
Expand Down

0 comments on commit f82422b

Please sign in to comment.