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

Non-code shapes do not respect text layout / indentation #2365

Closed
HariSekhon opened this issue Feb 20, 2025 · 3 comments
Closed

Non-code shapes do not respect text layout / indentation #2365

HariSekhon opened this issue Feb 20, 2025 · 3 comments

Comments

@HariSekhon
Copy link

This works as expected:

    json_config: |json
      {
        "json_config":
          ...
      }
    | {
      shape: code
      style.multiple: true  # doesn't work on code shape
    }
Image

but since the style.multiple doesn't work as per #2364 when I switch to another shape, it doesn't respect the text indentation, eg:

    json_config: |json
      {
        "json_config":
          ...
      }
    | {
      shape: rectangle
      style.multiple: true  # now works
    }

ruined text alignment:

Image
@cyborg-ts cyborg-ts added this to D2 Feb 20, 2025
@alixander
Copy link
Collaborator

Indeed, markdown/code cannot be set as labels. We'll do #2364

@alixander alixander closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2025
@github-project-automation github-project-automation bot moved this to Done in D2 Feb 21, 2025
@HariSekhon
Copy link
Author

Shouldn't non-code shapes respect the contents of spacing and indentation regardless though?

I believe these are two separate issues which is why I raised 2 separate tickets.

@alixander
Copy link
Collaborator

alixander commented Feb 21, 2025

Labels don't preserve spacing, like HTML. That's really only useful for the code case. This decision just makes it easier for 99% of use cases where users don't intend to preserve spacing, e.g. extra spaces between

a.label: hello        # extra spaces are trimmed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants