Skip to content

Conversation

@alexwarren
Copy link
Collaborator

Closes #197

Describe your changes

This PR make it so that if a code block is the first thing in a document, then when you press Enter at the start of that code block, a paragraph is created above.

This only applies if you're at the start of the code block, and only if that code block is the first thing in the doc.

Screen.Recording.2025-02-28.at.11.10.40.mov

PR Checklist

  • All new/changed functionality includes unit and (optionally) e2e tests as appropriate
  • All new/changed functions have /** ... */ docs
  • I've added the bug/enhancement and other labels as appropriate

Environment(s) tested

Chrome, Safari

@alexwarren alexwarren changed the title Issue197 fix(code-block) press Enter at start of first code block to create paragraph Feb 28, 2025
@alexwarren alexwarren changed the title fix(code-block) press Enter at start of first code block to create paragraph fix(code-block): press Enter at start of first code block to create paragraph Feb 28, 2025
@alexwarren alexwarren changed the title fix(code-block): press Enter at start of first code block to create paragraph fix(code-blocks): press Enter at start of first code block to create paragraph Feb 28, 2025
Copy link
Contributor

@dancormier dancormier left a comment

Choose a reason for hiding this comment

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

Nice work @alexwarren! I looked through the code seems solid. Only once minor suggested change on my part. Once that's resolved, I'm good to see this merged. Thanks!

Out of scope (no changes expected)

I start to get a little scared when I see files with more than a couple hundred lines. Long term, I think we'd be wise to separate src/rich-text/commands/index.ts and the related test file into per-function files. This would probably make maintenance and modification easier.

@dancormier dancormier self-requested a review March 3, 2025 19:07
@alexwarren alexwarren merged commit 94bac97 into StackExchange:main Mar 4, 2025
4 checks passed
@alexwarren alexwarren deleted the issue197 branch March 4, 2025 09:18
This was referenced Apr 1, 2025
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.

bug(rich-text) no way to advance above a code block that is the first element

3 participants