feat: integrate markdown parsing into SuperDoc#796
Conversation
harbournick
left a comment
There was a problem hiding this comment.
Looking good! just a minor comment to move convertMarkdownToHTML and prepareHTMLForSuperDoc to some helpers folder rather than making this Editor private methods. likely means the use of 'marked' will move to the helper and the import can be removed from Editor.js
Just an effort to keep this already huge class smaller!
| */ | ||
| #convertMarkdownToHTML(markdown) { | ||
| // Configure marked for better compatibility | ||
| marked.setOptions({ |
There was a problem hiding this comment.
worth double checking if the copilot is right
…ated helper modules
There was a problem hiding this comment.
Pull Request Overview
This PR integrates markdown parsing functionality into SuperDoc, enabling users to upload and process markdown files alongside existing document formats. The implementation converts markdown to HTML internally and leverages existing HTML import capabilities.
Key changes:
- Added markdown file support to upload components (
.mdextension) - Created markdown-to-HTML conversion utilities using the
markedlibrary - Updated SuperDoc configuration handling to support markdown content
- Enhanced test coverage for markdown import functionality
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
shared/common/components/BasicUpload.vue |
Added .md to accepted file types |
packages/superdoc/src/stores/superdoc-store.js |
Added markdown config handling |
packages/superdoc/src/dev/components/SuperdocDev.vue |
Enhanced file handling for markdown and HTML files |
packages/superdoc/src/core/SuperDoc.js |
Added markdown property to JSDoc configuration |
packages/superdoc/src/composables/use-document.js |
Added markdown parameter support |
packages/superdoc/src/SuperDoc.vue |
Passed markdown property to editor options |
packages/super-editor/src/core/helpers/importMarkdown.js |
New markdown conversion utilities |
packages/super-editor/src/core/helpers/importHtml.js |
Extracted HTML import helper |
packages/super-editor/src/core/Editor.js |
Integrated markdown support into editor initialization |
packages/super-editor/src/components/SuperEditor.vue |
Enhanced file handling for non-DOCX files |
packages/super-editor/src/core/super-converter/exporter.js |
Added heading node export functionality |
packages/super-editor/package.json |
Added marked library dependency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
harbournick
left a comment
There was a problem hiding this comment.
All looks good but could you please add some unit tests (in the same folder, next to the file) for:
packages/super-editor/src/core/helpers/importHtml.js
packages/super-editor/src/core/helpers/importMarkdown.js
Also add // @ts-check at the top of these and verify any typing issues are working. Since these are small self-contained files we should be able to pass ts validation
…ecks and improved parsing logic
No description provided.