-
Notifications
You must be signed in to change notification settings - Fork 185
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
feat: Add code block indentation token support #324
base: master
Are you sure you want to change the base?
Conversation
🤔 I don't understand the test failures here. The before/after looks the same in most cases. Is the spacing token I'm using different than the one used previously? |
I fixed a bug related to this. The visible diff now is expected since the codeblock is being rendered with the MarginWriter that includes padding that wasn't there before. Would appreciate some help on figuring out how to updating the golden files to reflect this change if it sound reasonable |
Hey @jahvon do you mind providing steps to repro? I've tried adding |
I've done something similar when testing this out. You'll also need to add |
@jahvon ah I see, thank you! We should probably clean that up at some point, but for now that's okay, we'll just have to include that in the docs. I believe this PR also adds an extra space to the end of codeblocks. Ideally, we can sort that out so it doesn't cause any inconsistency for background colours. |
If it's helpful for debugging, you can generate new golden files with |
Hey @bashbunni, I've done some refactoring to get spacing for code blocks to work a bit more like a block element. I think I got it to a decent state but would love to get the fix I'm proposing in #334 first. That fix isolates another change needed to get this working. |
Co-authored-by: Maximilian Moehl <[email protected]>
This change incorporates the specified indentation token when rendering code blocks. It includes fixes to how the margin and indentation tokens are rendered globally. When both are specified, the margin is rendered first as an empty space. This PR is another attempt at adding the functionality from charmbracelet#299
This change incorporates the specified indentation token when rendering code blocks. It includes fixes to how the margin and indentation tokens are rendered globally. When both are specified, the margin is rendered first as an empty space.
This PR is another attempt at adding the functionality from #299
Code block with a margin & indent token
Code block with just an indent token
Fixes #101
Depends on #334