Skip to content

Problem in pantry when section name contains space #292

Closed

Description

@pp140466

cookcli 0.27.1

In cook server mode when you have pantry.conf with sections name containing space like ["Garage Freezer"] (seems to be valid refering to TOML v1.0.0)
then the actions Add Item, Remove item or Edit item corrupt thr pantry.conf file : the double quotes are removes from the names these sections.
(Note that for items whose name contain a space, this works correctly)

Looking at cookcli\src\server\handlers\pantry.rs

in function fn serialize_pantry_to_regular_toml() :

line 380
writeln!(&mut output, "[{section_name}]").unwrap();
should be replaced by
writeln!(&mut output, "[{}]", toml_escape_key(section_name)).unwrap();

Same update may also be made to cookcli\src\pantry.rs in function fn serialize_pantry_to_toml() line 32

Activity

  1. added a commit that references this issue on Apr 2, 2026
    818f785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions