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

Preserve whitespace in Ruby AST representation #3

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

sambostock
Copy link
Contributor

@sambostock sambostock commented Mar 21, 2022

Using <pre><code> causes Bootstrap to style the AST as code, using a monospace font and preserving whitespace.

Applying white-space: pre-wrap causes the text to wrap if it is too wide to fit in the element (as opposed to making the element wider or overflowing).

I haven't been able to try this out locally, but I've tried editing the HTML in production and this produces a decent result.

Before After
image image

Tentatively closes #2

Using `<pre><code>` causes [Bootstrap to style the AST as
code][bootstrap-code-block], using a monospace font and preserving whitespace.

Applying `white-space: pre-wrap` causes the text to wrap if it is too wide to
fit in the element (as opposed to making the element wider or overflowing).

[bootstrap-code-block]: https://getbootstrap.com/docs/4.5/content/code/#code-blocks
@marcandre marcandre merged commit 51309bf into marcandre:master Mar 17, 2023
@marcandre
Copy link
Owner

Oh my, this fell through the cracks, I'm soo sorry.

I ❤️ it, fabulous!

Thank you!

Merged and deployed.

@sambostock sambostock deleted the format-ast branch March 17, 2023 21:06
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.

Use code block for AST
2 participants