word edit: fix image convert arrays
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 24 May 2020 04:16:28 +0000 (06:16 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 6 Jun 2020 01:49:20 +0000 (03:49 +0200)
writer.plp

index ce421b8d691ffca1b7b35321c5e8d923935c2f19..73ae3acf3c1bbd51259c6a49eba2e0c847f64be4 100644 (file)
@@ -55,9 +55,11 @@ my $title = $find ? "entry <small>#$Request</small>" : 'new entry';
 <:
 
 for my $col (pairs @wordcols) {
+       my $val = $row->{$col->key} // '';
+       $val = '{'.join(',', map {s/,/\\,/gr} @{$val}).'}' if ref $val eq 'ARRAY';
        printf '<dt><label for="%s">%s</label></dt>'
                . '<dd><input id="%1$s" name="%1$s" value="%s" />',
-               $col->key, $col->value, $row->{$col->key} // '';
+               $col->key, $col->value, $val;
        say '</dd>';
 }
 :>