Thanks for i the given example was only a example of a section of a yml file...
But the forum here eats spaces too...

the structure of a orginal yml are so:

Quote
BlackListedBlocks:
..- BEDROCK
..- OBSIDIAN
..- DIAMOND
..- DIORITE

the white points befor the -
Serve to display the spaces.

The correct output would then be:
Quote
..- BEDROCK
..- OBSIDIAN
..- DIAMOND
..- DIORITE

However, the structure of the yml should be taken into account when outputting, i.e.: If in the example yml under Blacklistedblocks there are entries with spaces, they should not be missing in the output...

Note
Other yml files could store a different structure so that the given code no longer works, so there must be a general code for all yml files.

Not that an extra alias has to be written for each yml in order to read it out. That's not the case with $read or $readini either... $read randomly reads a line from a file. The disadvantage is that it eats the spaces at the beginning of a file, so $read doesn't work with yml files.

The same applies to $readini..

With Readini, the sections have to be marked with [], so it doesn't work with yml files either.

So we are looking for a function similar to $read and $readini that works for yml files.