Skip to content

WIP: Attempt to fix the "box model" of code blocks #1318

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

Closed
wants to merge 3 commits into from

Conversation

NoahTheDuke
Copy link
Contributor

An alternative to #1317. Follows the algorithm described in #1317 (comment):

  1. If there is any text on the line containing the opening braces, ignore it for now.
  2. Find the least indented line in the remaining lines, store the indent as the left edge of the box.
  3. Remove the left edge indentation of each remaining line.
  4. If there is any text on the line containing the opening braces, trim the whitespace and insert it at the front.

Adds tests of all examples from the above issue (including 9) which is considered invalid).

@NoahTheDuke NoahTheDuke mentioned this pull request Feb 20, 2025
2 tasks
@NoahTheDuke NoahTheDuke closed this Mar 3, 2025
@NoahTheDuke NoahTheDuke deleted the nb/fix-box-model branch March 3, 2025 21:36
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