-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
base: main
Are you sure you want to change the base?
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: |
if (node.tagName === "video") { | ||
const src = node.properties?.src || node.properties?.["data-url"] || ""; | ||
const name = | ||
node.properties?.title || node.properties?.["data-name"] || ""; | ||
parent.children[index!] = { | ||
type: "text", | ||
value: ``, | ||
}; |
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.
Based on the test cases, I don't know that this is working entirely correctly.
It is being rendered to a link here: tests/src/unit/core/formatConversion/export/snapshots/html/video.html which I don't fully get why. So, it makes sense why this parse would not actually pick it up.
This may have to do with the way we output internal html vs external HTML?
I think we should hold off on merging this until we change up the default block API in #1904
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 🙏 |
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