Skip to content

feat: integrate markdown parsing into SuperDoc#796

Merged
caio-pizzol merged 13 commits intodevelopfrom
feature/har-10088-superdoc-markdown-support
Aug 22, 2025
Merged

feat: integrate markdown parsing into SuperDoc#796
caio-pizzol merged 13 commits intodevelopfrom
feature/har-10088-superdoc-markdown-support

Conversation

@caio-pizzol
Copy link
Copy Markdown
Contributor

No description provided.

@caio-pizzol caio-pizzol requested review from chittolinag, Copilot and harbournick and removed request for harbournick August 21, 2025 23:22

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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({
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth double checking if the copilot is right

Comment thread packages/super-editor/src/core/Editor.js Outdated
@caio-pizzol caio-pizzol enabled auto-merge (squash) August 22, 2025 11:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (.md extension)
  • Created markdown-to-HTML conversion utilities using the marked library
  • 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.

Comment thread packages/super-editor/src/core/super-converter/exporter.js
Comment thread packages/super-editor/src/core/helpers/importHtml.js
Comment thread packages/super-editor/src/components/SuperEditor.vue
Comment thread packages/superdoc/src/dev/components/SuperdocDev.vue
Copy link
Copy Markdown
Collaborator

@harbournick harbournick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread packages/super-editor/src/core/Editor.js Outdated
Comment thread packages/super-editor/src/components/SuperEditor.vue Outdated
@caio-pizzol caio-pizzol disabled auto-merge August 22, 2025 18:23
@caio-pizzol caio-pizzol merged commit f1a2cf4 into develop Aug 22, 2025
7 checks passed
@caio-pizzol caio-pizzol deleted the feature/har-10088-superdoc-markdown-support branch August 22, 2025 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants