derat / yambs

Moved to codeberg.org/derat/yambs
https://codeberg.org/derat/yambs
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Accept newlines in key=val text input #28

Open derat opened 1 year ago

derat commented 1 year ago

Right now, I think that there's no way to embed newlines in values when using the "keyval" input format. I think that edit notes have been the only potentially multiline fields so far, but event setlists (see #27) probably always contain multiple lines.

The code that reads input just splits on newlines:

https://github.com/derat/yambs/blob/9c0bba063b2682404c7b18120c1c13614abc7695/sources/text/read.go#L184-L199

The web interface unescapes \t and \n in the "set" textarea for CSV and TSV input:

https://github.com/derat/yambs/blob/9c0bba063b2682404c7b18120c1c13614abc7695/render/page.tmpl#L693-L708

I'm not sure if the keyval format is particularly useful, but I could probably change newRowReader to unescape tabs and newlines in a similar manner.