#647·js-yaml

linewidth just for strings

Author: thernstigCreated Nov 22, 2021Updated Sep 13, 2026

Hi!

I want my strings to get the output of this format:

yaml
    # What I get
    abcde_abcdefgh_abcdef: Foo foo foo foo foo foo foo foo foo foo foo foo foo foo foo fo
    # What I want
    abcde_abcdefgh_abcdef: Foo foo foo foo foo foo foo foo foo foo foo foo foo
      foo foo fo

I have tried this in all possible ways, but without succeeding and wonder if this is possible. The reason for this is that we have a YAML file read and dumped by both this library, as well as PyYAML in Python (https://pyyaml.org/) but end up with different formatting for strings like above, since PyYAML moves long strings to new multi-lines rows.