-
-
Notifications
You must be signed in to change notification settings - Fork 621
Fix: video parsing and Markdown export issues #1955
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
Conversation
@Hector-Zhuang is attempting to deploy a commit to the TypeCell Team on Vercel. A member of the Team first needs to authorize it. |
@matthewlipski @nperez0111 @YousefED |
Try to maintain or fork a repository of this project. This is what I'm doing. I've been fixing bugs while integrating this with my work |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
packages/core/src/api/exporters/markdown/util/convertVideoToMarkdownRehypePlugin.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's wait for: #1904
@iyansr feel free to use the pkg pr new versions that were generated above. They'll include this and some unreleased changes |
@nperez0111 I got this when i install from pkg pr |
@iyansr |
@nperez0111 Should I install all with the pkg.pr.new ? |
Yep, that should be it @iyansr |
The issue still exist unfortunately 🥲 |
You likely have duplicates somewhere, look around for duplicate versions using |
Sure, I will try, thanks for helping 🙏 |
return parts[parts.length - 1]; | ||
} | ||
|
||
export function isVideoUrl(url: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nperez0111 how do you feel about checking if a file is a video based on a hard coded list of file endings? The alternative would be to get it from the meta.fileBlockAccept
field in the video block's implementation. It would be nice to use this instead of a hard coded list, but I'm wary of what happens if someone replaces the default video block with their own. Wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think hard-coding is fine for now, this is what the markdown parser would've done anyway.
Thanks @Hector-Zhuang for this! |
Description:
This PR addresses two issues related to
<video>
elements in the editor:Video parsed as an image
Previously,
<video>
elements were being processed by the image handler inremarkRehype
, causing videos to be treated as images.Video exported as a link in Markdown
When exporting content containing videos to Markdown, the videos were incorrectly serialized as standard link Markdown:
Fixes implemented:
Updated the image handler to detect videos by extension (mp4, webm, etc.) and process them as
<video>
elements with the correct attributes: src, data-url, data-name and so on.Added a
convertVideoElementToMarkdown
plugin to transform<video>
elements into a dedicated video markdown with url and title.#1938