Skip to content

fix: wi create/update -d wraps HTML in <p>, nesting block elements #32

Open

Description

@cpatrickalves

Describe the bug

wi create -d and wi update -d wrap the value as f"<p>{description}</p>" (commands/work_items.py). The help text says the value is "plain text", while the README/skill say it is raw HTML. In practice:

Workaround used for a bulk create of 31 issues with rich descriptions: pass -d "</p>${html}<p>" so the wrapper closes and reopens around the real content.

Expected behavior

  • Convert -d through planecli.utils.body_html.body_to_html, the function doc create/update already use. It already turns plain text into paragraphs (one <p> per blank-line-separated block, <br/> for single newlines), links bare URLs and converts code spans.

  • If the value already looks like HTML (starts with < after strip()), store it as is. body_to_html does not do this yet: body_to_html('<h2>T</h2><ul><li>x</li></ul>') returns '<p><h2>T</h2><ul><li>x</li></ul></p>', so the pass-through belongs in body_to_html, where it also fixes doc --content.

  • Fix the --description help text to say which formats are accepted.

  • When wi update -i appends to an existing description, unwrap the server's outer <div> first, so repeated appends do not nest.

Related

Environment

  • planecli 0.5.1, plane-sdk 0.2.6
  • Plane v2.1.2 Commercial, self-hosted

Activity

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