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

Add lineBreakReplacer extension for CodeBlock #2571

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

Alex-Tideman
Copy link
Contributor

@Alex-Tideman Alex-Tideman commented Feb 20, 2025

Description & motivation 💭

Replace \n in CodeBlock values with actual line breaks to make it easier to read. Will not replace if editing CodeBlock values

Screenshots (if applicable) 📸

Before
Screenshot 2025-02-20 at 3 22 06 PM

After
Screenshot 2025-02-20 at 3 21 54 PM

Before
Screenshot 2025-02-20 at 3 28 57 PM

After
Screenshot 2025-02-20 at 3 29 10 PM

Design Considerations 🎨

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

Copy link

vercel bot commented Feb 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 20, 2025 9:31pm

Copy link
Contributor

@rossedfort rossedfort left a comment

Choose a reason for hiding this comment

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

What about text vs. json? We might not want to add line breaks if there's a \n in the middle of a JSON payload or something, like

{
  "key": "my super long value\nwith a new line in it"
}

@Alex-Tideman
Copy link
Contributor Author

That's kinda the whole point, when it's json with several fields, and users want to line break long strings in a json payload. Like that second pair of screenshots, I think it's always easier to read with a linebreak.

@Alex-Tideman Alex-Tideman merged commit 4fa15ab into main Feb 20, 2025
15 checks passed
@Alex-Tideman Alex-Tideman deleted the line-break-extension branch February 20, 2025 22:39
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.

2 participants