You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a field has a trailing newline, it can be marshaled as a separate paragraph.
I see that in parsing you take special precautions for the case of a line that is a single space/tab followed by a period (https://github.com/paultag/go-debian/blob/master/control/parse.go#L228-L230) to treat that as an empty line. But when you marshal a property that has trailing newlines you don't currently take any special precautions.
Meaning that when I go to marshal an array of objects I can end up with:
ID: 1
Description: Description here
and continues here.
Name: Object1
ID: 2
Description: Single-line desc
Name: Object2
which now gets improperly parsed.
Would you argue that it's the client's responsibility to prune such trailing newlines before serializing? Or would you be open to a PR that alters the serialization behavior to take advantage of that special case mention above and translate trailing newlines to include a leading whitespace and a period so that it gets rendered like so:
ID: 1
Description: Description here
and continues here.
.
Name: Object1
ID: 2
Description: Single-line desc
Name: Object2
I believe that could be parsed properly.
The text was updated successfully, but these errors were encountered:
Ah, cool! Nice bug. Yeah, the marshal code should handle this right, if I give it the raw text of a document, it shouldn't generate something invalid. Nice catch!
If a field has a trailing newline, it can be marshaled as a separate paragraph.
I see that in parsing you take special precautions for the case of a line that is a single space/tab followed by a period (https://github.com/paultag/go-debian/blob/master/control/parse.go#L228-L230) to treat that as an empty line. But when you marshal a property that has trailing newlines you don't currently take any special precautions.
Meaning that when I go to marshal an array of objects I can end up with:
which now gets improperly parsed.
Would you argue that it's the client's responsibility to prune such trailing newlines before serializing? Or would you be open to a PR that alters the serialization behavior to take advantage of that special case mention above and translate trailing newlines to include a leading whitespace and a period so that it gets rendered like so:
I believe that could be parsed properly.
The text was updated successfully, but these errors were encountered: