I'm deep into creating it and hit upon the following "little" problem.
What should be done about the final line break in a folded value?
Obviously the final line break is included in escaped scalars (the final
line break can always be escaped if it isn't desired).
For block scalars, it is OK to include it (the main use case, quoted code
and such, requires it).
But for folded... I'm unhappy with either choice. Consider:
Doesn't look like it should
end with a line break. After
all it is just one long string.
while this: |]
Sure looks like it should. It
consists of what looks like
It contains line breaks. It even
ends with an empty line (which
under the vague rules we suggested
would be a comment).
1. Force one option (with/out final line break). Force anyone needing the
other to switch to block or escaped style. Awkward.
2. Add a chomped variant to folded. Complicates things.
3. Say that an empty line following the last text line in a folded value
indicates a final line break, and that otherwise the final line break is
ignored. Obscure (and makes it impossible to have an empty separator line
after one kind of block leaf).
I think we are forced to go with (2). Given that this would be a common use
case, perhaps we should investigate alternative notation for it.
2.1. Use a non orthogonal notation. For example, '|]' for non chomped folded
and '|;' or '|)' or '|>' for chomped folded. ';' carries over the notion of
"terminator". '>' can be thought of as being "more folded" than ']'. ')'
could argue be thought off as "less folded" - maybe ')' should be for
non-chomped and ']' for chomped?
This would look better but would make it harder to come up with a chomped
version of block later on, if we decide we want one (we could of course
create a new non-orthogonal notation for that - say, '||' for a chomped
Greater than: |>
2.2 Use orthogonal notation using something other than '-'. Using ';', for
example, gives us '|];' for chomped folded. Another interesting notion is to
use '|', giving us '||]'. Either way this allows us to define '|;' or '||'
later on if we think chomped block is necessary.
Vertical bar: ||]
Or maybe: |]|
2.3 Use orthogonal notation using the current '-' (that is, allow '|]-').
I think visually, |) and ||] seem the least "noisy". I'd go for |) and |]
(if orthogonality can be ignored), with ||] being my second choice (if
orthogonality is important enough). But I don't want to make a big issue out
of this. Anything Clark/Brian agree upon would be OK with me.