-
| 
         Hi all, So I have multi-line strings that are attached as class variables, but the default formatting ignores and renders newline characters inline. So for example this snippet: class Foo:
    BAR: ClassVar[str] = """
        layout: vertical;
        align: center middle;
        height: auto;
        width: auto;
    """
    """Random Docstring"""Renders out to this: My wish is to be able to format these strings, so they are displayed and newlines are properly formatted, similar to how  Is there a built-in way to change this? Otherwise I think this would be a great feature to add.  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
| 
         Yes that's a limitation of our static analysis agent:  I see two solutions to this: 
 It might also be possible to work around this with a Griffe extension, but I'm not sure if that's possible yet, I'll have to run some tests. The extension would accept a list of object paths, and simply go and update these object values to transform strings as triple-quoted strings.  | 
  
Beta Was this translation helpful? Give feedback.

Yes that's a limitation of our static analysis agent:
astgives us regular strings, and we loose the information of whether they were triple-quoted strings or not. Then, when "unparsing" expressions, we cannot know whether we should render as regular or triple-quoted strings.I see two solutions to this:
It might also be possible to work around this with a Griffe extension, but I'm not sure if that's possible yet, I'll have to run some tests. The extension would ac…