Skip to content

Commit

Permalink
Merge pull request #50 from ddazal/master
Browse files Browse the repository at this point in the history
Add support to pdf files selected via MediaLib dialog
  • Loading branch information
nshenderov authored Jan 12, 2023
2 parents e0f3f94 + 936f6ef commit c9b0a58
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions admin/src/components/CKEditor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ const Editor = ({ onChange, name, value, disabled }) => {
const imgTag = `<img src="${asset.url}" alt="${asset.alt}"></img>`;
newValue = `${newValue}${imgTag}`;
}
} else if (asset.mime.includes("application/pdf")) {
const downloadTag = `<a href="${prefixFileUrlWithBackendUrl(asset.url)}" download="${asset.alt}">${asset.alt || 'Download PDF'}</a>`
newValue = `${newValue}${downloadTag}`
}
// Handle videos and other type of files by adding some code
});
Expand Down

0 comments on commit c9b0a58

Please sign in to comment.