-
Notifications
You must be signed in to change notification settings - Fork 107
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
Markdown improvement #547
Markdown improvement #547
Conversation
packages/core/src/markdown.ts
Outdated
return res | ||
} | ||
|
||
function eatTooManyNewlines(res: string): string { | ||
return res?.replace(/\n{3,}/g, "\n\n") |
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 regular expression \n{3,}
in the replace
function will replace three or more consecutive newline characters with two newline characters. This might not be the desired behavior if the intention was to replace two or more consecutive newline characters with a single newline character. Please review the regular expression pattern. 🕵️♀️
generated by pr-review-commit
regex_pattern
LGTM 🚀 The changes in GIT_DIFF show that a new function This function is then used in the The update to the These changes improve the readability of the generated Markdown and pull request descriptions by eliminating excessive whitespace. I didn't find any functional issues with these changes. 👍
|
The file
your-first-genai-script.mdx
has been updated.The
github.ts
file in the core package has a new line added that applies theprettifyMarkdown
function to the text. This helps ensure that the pull request descriptions are always formatted correctly. 📝💅In the
markdown.ts
file, a new functioneatTooManyNewlines
has been added to theprettifyMarkdown
function.eatTooManyNewlines
function replaces any instance of three or more newline characters with just two. This helps make the markdown content more readable by eliminating excessive whitespace. 📚💁♂️These changes seem to focus on improving the readability and user experience of script outputs and Github pull request descriptions.