Allow customizing block sequence indentation
Hi,
right now snakeyaml emits block sequences with a hard-coded zero indentation before the list indicator, e.g.:
aaa:
bbb:
- x1
- x2
I would like to be able to further customize the indentation and be able to specify a whitespace ammount before the list indicator, so that I have an output like this (or whatever whitespace I want before the list indicators):
aaa:
bbb:
- x1
- x2
I've digged in Emitter.java and found that it indeed emits the list indicator right after emitting the parent block's indentation, my proposal is to allow a whitespace by pushing another intermediate indentation state:
592. writeIndent();
593. writeIndicator("-", true, false, true);
the fix should be minimal, I can help with it
thank you
Comments (6)
-
-
Account Deleted -
-
assigned issue to
I have accepted the change. I will add minor things.
-
assigned issue to
-
Please check the latest snapshot - 1.17
-
Account Deleted hi @asomov , my initial checks give positive results. thanks for the cooperation!
-
- changed status to resolved
It will be delivered in version 1.17
- Log in to comment
Feel free to submit a patch or pull request with tests. We would like to see the complete change (together with DumperOptions) If you are quick then it can be released this month.