You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
which D2, in turn, renders as a node with label Some:
But surely, what the user wanted here was to have the newline escaped
SomeShape: Some\nlabel
so that D2 renders it as a node with a multi-line label:
The same issue applies to other characters interpreted specially by D2, specifically \, {, }, " and ' (there might be others, not sure).
Would fixing this constitute a breaking change?
One problem I foresee is that other users of this library might have started to work around this by quoting/escaping the labels they give to py-d2 themselves, so once this gets fixed, their \ characters are escaped to \\, " are escaped to \" etc., breaking their code.
I don't know if there is a good way around this. One option would be to leave label as it is and introduce a new parameter smart_label or whatever, but that makes things needlessly complicated for new users.
So maybe it should just get fixed in the normal, potentially-breaking manner but be held back until a new major version release?
Related issues / PRs
Icons and empty labels support #19 attempts to fix empty labels, which are broken due to the same underlying issue of rendering labels verbatim
The text was updated successfully, but these errors were encountered:
Description
Problem description
Consider e.g. a label with a newline in it:
py-d2 renders this as
which D2, in turn, renders as a node with label
Some
:But surely, what the user wanted here was to have the newline escaped
so that D2 renders it as a node with a multi-line label:
The same issue applies to other characters interpreted specially by D2, specifically
\
,{
,}
,"
and'
(there might be others, not sure).Would fixing this constitute a breaking change?
One problem I foresee is that other users of this library might have started to work around this by quoting/escaping the labels they give to py-d2 themselves, so once this gets fixed, their
\
characters are escaped to\\
,"
are escaped to\"
etc., breaking their code.I don't know if there is a good way around this. One option would be to leave
label
as it is and introduce a new parametersmart_label
or whatever, but that makes things needlessly complicated for new users.So maybe it should just get fixed in the normal, potentially-breaking manner but be held back until a new major version release?
Related issues / PRs
The text was updated successfully, but these errors were encountered: