Skip to content

fix: escape Rich markup in catalog list output#3738

Open
Noor-ul-ain001 wants to merge 1 commit into
github:mainfrom
Noor-ul-ain001:fix/catalog-list-markup-escape
Open

fix: escape Rich markup in catalog list output#3738
Noor-ul-ain001 wants to merge 1 commit into
github:mainfrom
Noor-ul-ain001:fix/catalog-list-markup-escape

Conversation

@Noor-ul-ain001

Copy link
Copy Markdown
Contributor

Summary

The catalog list subcommands print user-editable catalog fields (name, url, description from the *-catalogs.yml config files) through console.print, which has Rich markup enabled. Any bracketed content is parsed as a style tag and silently swallowed — e.g. a catalog description Does [stuff] nicely renders as Does nicely — and a malformed tag can raise while rendering.

This affects four commands whose sibling extension catalog list already escapes these fields:

  • specify workflow catalog list (workflows/_commands.py)
  • specify workflow step catalog list (workflows/_commands.py)
  • specify preset catalog list (presets/_commands.py)
  • specify integration catalog list (integrations/_query_commands.py)

Fix

Route each untrusted field through the module's already-imported escape helper (from rich.markup import escape), matching the reference pattern in extension catalog list. No new imports.

Tests

Adds a regression test per command that injects bracketed name/url/description and asserts the brackets survive verbatim in the output. Confirmed each test fails without the corresponding source fix (test-the-test via stash).

The 20 unrelated test_workflows.py symlink-guard failures in my local run are pre-existing Windows-without-elevation failures, not touched by this change.

🤖 Generated with Claude Code

The `catalog list` subcommands for workflows, workflow steps, presets,
and integrations printed user-editable catalog fields (name/url/
description from the `*-catalogs.yml` files) through `console.print`
with Rich markup enabled. Any bracketed content such as a description
`Does [stuff] nicely` was parsed as a style tag and silently swallowed,
and a malformed tag could raise while rendering.

Route each untrusted field through the module's already-imported
`escape` helper, matching the pattern already used by
`extension catalog list`.

Adds regression tests for all four commands that inject bracketed
name/url/description and assert the brackets survive verbatim in the
output.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Noor-ul-ain001
Noor-ul-ain001 requested a review from mnriem as a code owner July 25, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant