-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Improve the display of attached files #61
Comments
It's possible to extract filename from S3 Url using regex: case "pdf":
{
let blockContent;
if (type === "video")
blockContent = block.video;
if (type === "file")
blockContent = block.file;
if (type === "pdf")
blockContent = block.pdf;
if (blockContent) {
const file_type = blockContent.type;
let link;
if (file_type === "external")
link = blockContent.external.url;
if (file_type === "file")
link = blockContent.file.url;
if (link) {
const matches = link.match(/[^\/\\&\?]+\.\w{3,4}(?=([\?&].*$|$))/);
let fileName = matches ? matches[0] : "Image";
return md.link(fileName, link);
}
}
}
break; |
Keeping this on hold since a feature to deal with the s3 urls is work in progress. More details here #60 |
souvikinator
added a commit
that referenced
this issue
May 16, 2023
souvikinator
added a commit
that referenced
this issue
May 16, 2023
This feature should be live in the upcoming major release. Thank you for contribution. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Attached files (Pdf/File/Video) are displayed via an "Image" link
It would be nice if a link with the file name was displayed.
The text was updated successfully, but these errors were encountered: