-
Notifications
You must be signed in to change notification settings - Fork 1
[CAI-558] [CAI-569] Fix link parsing in chat, update documentation parsing for special character \ #1712
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
🦋 Changeset detectedLatest commit: 82dc956 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Jira Pull Request LinkThis Pull Request refers to the following Jira issue CAI-558 |
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.
Pull Request Overview
This PR fixes parsing issues in chat messages and markdown documentation by addressing link formatting and special character handling. The changes improve how links are displayed in chat messages and resolve backslash character issues in markdown processing.
- Enhanced chat message link parsing with better title resolution and formatting
- Fixed markdown parsing to remove unwanted backslash characters
- Added changeset documentation for version tracking
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
apps/nextjs-website/src/helpers/chatMessageParser.helper.ts | Enhanced link parsing logic with title resolution from GitBook pages and anchor formatting |
packages/gitbook-docs/src/scripts/parseDocUrlsAndIncludes.ts | Added backslash character removal in markdown processing |
.changeset/nice-ravens-mate.md | Added changeset entry for version tracking |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
node.transformChildren(config) | ||
const attrs = node.transformAttributes(config); | ||
const gitBookPagesWithTitle: ReadonlyArray<PageTitlePath> = | ||
config.variables ? [...config.variables.gitBookPagesWithTitle] : []; |
Copilot
AI
Sep 30, 2025
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.
The spread operator creates a new array unnecessarily. Since you're only reading from the array, you can use it directly: config.variables?.gitBookPagesWithTitle || []
config.variables ? [...config.variables.gitBookPagesWithTitle] : []; | |
config.variables?.gitBookPagesWithTitle || []; |
Copilot uses AI. Check for mistakes.
const titleFromPage = | ||
childrenTreeNode && | ||
typeof childrenTreeNode[0] === 'string' && | ||
childrenTreeNode[0].endsWith('.md') && | ||
page | ||
? page.title | ||
: undefined; |
Copilot
AI
Sep 30, 2025
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.
[nitpick] This complex conditional logic should be extracted into a helper function for better readability and testability. Consider creating a getTitleFromPage
function.
Copilot uses AI. Check for mistakes.
const titleFromAnchor = | ||
childrenTreeNode && | ||
typeof childrenTreeNode[0] === 'string' && | ||
childrenTreeNode[0].startsWith('#') | ||
? capitalizeFirstLetter( | ||
childrenTreeNode[0].replace('#', '').replaceAll('-', ' ') | ||
) | ||
: undefined; |
Copilot
AI
Sep 30, 2025
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.
[nitpick] Similar to the previous comment, this conditional logic should also be extracted into a helper function like getTitleFromAnchor
for consistency and maintainability.
Copilot uses AI. Check for mistakes.
This pull request is stale because it has been open for 14 days with no activity. If the pull request is still valid, please update it within 21 days to keep it open or merge it, otherwise it will be closed automatically. |
import Markdoc, { Config, ConfigType, Node, Tag } from '@markdoc/markdoc'; | ||
import React, { ReactNode } from 'react'; | ||
|
||
import { PageTitlePath } from '@/helpers/parseS3Doc.helpers'; |
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.
import { PageTitlePath } from '@/helpers/parseS3Doc.helpers'; | |
import { PageTitlePath } from '@/helpers/parseS3Doc.helpers'; | |
List of Changes
Fix the parsing for links in chatbot messages, update the markdown parsing to remove \ characters
Motivation and Context
How Has This Been Tested?
localhost
Screenshots (if appropriate):
Types of changes
Checklist: