Skip to content

ascii mode: newlines in labels should not mess things up #2784

Description

@quinox

Real nice to see ASCII output!

Slight issue with newlines in labels: they appear to get ignored by the layout engine, resulting in broken output:

Input:

foobar -> buzbux: "foo\nbar"
buzbux: {
  label: "some\ntext"
}

Expected:

┌──────────┐  
│  foobar  │  
│          │  
└──────────┘  
      │       
     foo
     bar    
      │       
      ▼       
┌──────────┐
│          │
│   some   │
│   text   │
│          │
└──────────┘

Actual:

 ┌─────────┐  
 │ foobar  │  
 │         │  
 └─────────┘  
      │       
   foo
bar    
      │       
      ▼       
  ┌──────────┐
  │          │
  │some
text │
  │          │
  └──────────┘

https://play.d2lang.com/?script=SsvPT0osUtC1U0gqrUoqrbBSUErLz4_JS0osUuKCCVVzKSjkJCal5lgpKBXn56bG5JWkVpQocdVyAQIAAP__&ascii=1&

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions