Skip to content

Strings with line breaks cause invalid YAML output and multiline YAML strings not read correctly #202

@richardlehane

Description

@richardlehane

cf exponential-decay/demystify#95

YAML multi-line strings in single quotes should be indented (see e.g. this issue). Where new lines appear e.g. in file names, sf outputs unindented/ invalid output:

---
filename : 'Mac RF Test.zip#Mac RF Test\ProTools AppleSingle\Demo Session\Audio Files\Icon
'
filesize : 0
modified : 1996-11-14T13:29:32Z
errors   : 'empty source'
matches  :
  - ns      : 'pronom'
    id      : 'UNKNOWN'
    format  : 
    version : 
    mime    : 
    basis   : 
    warning : 'no match'
---
filename : 'Mac RF Test.zip#__MACOSX\Mac RF Test\ProTools AppleSingle\Demo Session\Audio Files\._Icon
'
filesize : 2790
modified : 1996-11-14T13:29:32Z
errors   : 
matches  :
  - ns      : 'pronom'
    id      : 'fmt/503'
    format  : 'AppleDouble Resource Fork'
    version : '2'
    mime    : 'multipart/appledouble'
    basis   : 'byte match at 0, 8'
    warning : 
---
filename : 'Mac RF Test.zip#Mac RF Test\ProTools AppleSingle\Demo Session\Audio Files\Icon
.as'
filesize : 2829
modified : 2022-03-03T10:20:10Z
errors   : 
matches  :
  - ns      : 'pronom'
    id      : 'fmt/968'
    format  : 'AppleSingle'
    version : '2'
    mime    : 'application/applefile'
    basis   : 'byte match at 0, 8'
    warning : 
---

This type of output will also break sf's YAML reader affecting -replay flag, roy compare etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions