Skip to content
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

Merged
merged 3 commits into from
Jun 15, 2024
Merged

Markdown improvement #547

merged 3 commits into from
Jun 15, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Jun 15, 2024

  • collapse too many new lines
  • The file your-first-genai-script.mdx has been updated.

    • The script definition in this file has been altered so that it now executes only user scripts, not system or assistant ones. 🤖 ➡️ 👤
    • The detail tag is now opened by default, making the user content immediately visible when the page loads. 🔍
  • The github.ts file in the core package has a new line added that applies the prettifyMarkdown function to the text. This helps ensure that the pull request descriptions are always formatted correctly. 📝💅

  • In the markdown.ts file, a new function eatTooManyNewlines has been added to the prettifyMarkdown function.

    • The 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.

generated by pr-describe

return res
}

function eatTooManyNewlines(res: string): string {
return res?.replace(/\n{3,}/g, "\n\n")

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

Copy link

LGTM 🚀

The changes in GIT_DIFF show that a new function eatTooManyNewlines has been added to the markdown.ts file. This function takes a string as input and replaces instances of three or more consecutive newline characters with two newline characters.

This function is then used in the prettifyMarkdown function to ensure that the Markdown text doesn't have too many successive newline characters.

The update to the github.ts file shows the prettifyMarkdown function being used to format the text of a pull request description.

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. 👍

generated by pr-review

@pelikhan pelikhan merged commit 7ba0043 into main Jun 15, 2024
9 checks passed
@pelikhan pelikhan deleted the markdown-improv branch June 15, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant