-
Notifications
You must be signed in to change notification settings - Fork 313
Fix indentation loss when markdown rendering is disabled #3032
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?
Fix indentation loss when markdown rendering is disabled #3032
Conversation
- Preserve leading spaces in code blocks when markdown is disabled - Add regression test for indentation preservation - Maintain backward compatibility when markdown is enabled Fixes issue where Python code indentation showed 3 spaces instead of 4 when chat.disableMarkdownRendering was set to true.
Just to confirm have you run the following? |
I did run the |
hmm, when I run the
the
Thanks! |
@pratik-m you should sync your work and perform git pull, there was a recent merge from maintainers to fix the cargo test failure |
Update test macro to support non-trimmed assertions and add test case for preserving leading whitespace when markdown is disabled.
Hi @nirajchowdhary - I pulled the changes and I needed to tweak the tests as well..Enhanced test macro to support non-trimmed assertions and added regression test for indentation preservation when markdown is disabled.
|
Fix indentation loss when markdown rendering is disabled
Problem
When
chat.disableMarkdownRendering
is set totrue
, Python code blocks lose one space per indentation level. Single indentation shows as 3 spaces instead of 4, and double indentation shows as 7 spaces instead of 8.Root Cause
The
fallback
function inparse.rs
was skipping spaces at column 1, which was intended for markdown formatting but caused indentation loss when markdown was disabled.Solution
Testing
markdown_disabled_indentation_preserved
addedBefore/After
Before:
After:
Files Changed
crates/chat-cli/src/cli/chat/parse.rs
- Fixed indentation logic and added test