Skip to content

Conversation

@thoda-dev
Copy link

@thoda-dev thoda-dev commented Dec 19, 2025

πŸ”— Linked issue

Resolves #5713

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • πŸ‘Œ Enhancement (improving an existing functionality)

πŸ“š Description

With the example in the current documentation for AI completion in the editor, after completion, the markdown formatting is not applied.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copilot AI review requested due to automatic review settings December 19, 2025 15:26
@github-actions github-actions bot added the v4 #4488 label Dec 19, 2025
Copy link

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 enhances the AI completion feature in the editor documentation example by adding markdown parsing and formatting support. Previously, markdown syntax like **bold** would be inserted as plain text; now it's properly rendered as formatted content.

Key changes:

  • Added markdown parsing logic to convert raw markdown text into TipTap nodes/marks during completion insertion
  • Implemented throttled streaming updates to improve performance during AI completion
  • Restructured completion state management to track inserted ranges and handle inline vs. block content appropriately

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
EditorUseCompletion.ts Added markdown parsing functions, throttling mechanism, and rewrote streaming insertion logic to apply markdown formatting during AI completion
EditorCompletionExtension.ts Modified suggestion acceptance to parse markdown content and increased debounce delay from 250ms to 2500ms


πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 19, 2025

npm i https://pkg.pr.new/@nuxt/ui@5714

commit: af69b5a

Copy link
Member

@benjamincanac benjamincanac left a comment

Choose a reason for hiding this comment

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

I think it would be easier for the sake of the example to update the prompt in completion.post.ts to prevent it from returning markdown πŸ€”

@thoda-dev
Copy link
Author

Probably, but I also think many people could encounter this "problem" while using code from the example and could see it as a bug

@benjamincanac
Copy link
Member

Closing in favor of 86b0fb1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: Editor is not formating markdown after completion in the example

2 participants