lucc / khard

Console vcard client
https://khard.readthedocs.io/en/latest/
GNU General Public License v3.0
595 stars 66 forks source link

Do not remove/concat multiline strings in YAML #328

Open pacien opened 11 months ago

pacien commented 11 months ago

Description of the issue:

Multiline YAML strings (using the | modifier) are concatenated with \n after going through Khard.

This is inconvenient when editing existing contacts.

It would be nice to write the YAML file in the human-friendly way keeping those multiline | string values.

Example:

  1. Create a new contact with khard new.

  2. Set some multiline property, as suggested by the default template, such as:

    Note: |
      First line.
      Second line.
  3. Save that contact.

  4. Re-open that contact with khard edit.

  5. Notice that the field is now shown for edition as:

    Note: "First line.\nSecond line."

Version info:

lucc commented 11 months ago

I think we serialize the data with the ruaml library. Maybe there is an option in the lib to do this.