Skip to content

feat(tickets,comments): support HTML rich-text descriptions and comments - #30

Merged
antonisobkowicz-asana merged 2 commits into
mainfrom
code-1176-html-notes
Sep 4, 2026
Merged

feat(tickets,comments): support HTML rich-text descriptions and comments#30
antonisobkowicz-asana merged 2 commits into
mainfrom
code-1176-html-notes

Conversation

@antonisobkowicz-asana

@antonisobkowicz-asana antonisobkowicz-asana commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds optional description_html to create_ticket/update_ticket (maps to Asana's html_notes) and text_html to add_comment (maps to html_text), each mutually exclusive with its plain-text counterpart.
  • Fixes an issue where Markdown written into description/text was sent to Asana verbatim and stored as literal text, since Asana's API does not render Markdown. Callers can now opt into rich formatting or @-mentions via the new HTML fields instead.
  • Deliberately does not auto-convert Markdown to HTML server-side — that would break this repo's authoritative re-read verification, since Asana's derived plain-text echo of an HTML field does not byte-match the original Markdown. Exposing a second HTML parameter and letting the caller choose keeps verification exact.
  • Verification for description_html/text_html compares against the raw re-read html_notes/html_text field rather than the projected plain-text view, so writes are verified correctly.
  • Adds a looksLikeMarkdown heuristic (src/markdown_heuristic.ts) that flags headings, bold/italic, inline/fenced code, links, and blockquotes in the plain-text description/text fields (deliberately excluding dash-bulleted lists, since those still read fine unconverted) and surfaces a same-turn warning in the mutation result nudging the caller toward description_html/text_html. The write still succeeds — this is a corrective nudge for callers that don't follow the parameter docs, not a rejection.

Test plan

  • npm run typecheck
  • npm run lint
  • npm test (359 tests passing, including coverage for create/update with description_html, verification mismatch cases, mutual-exclusivity rejection, add_comment with text_html, and the Markdown-heuristic warnings on both tools)
  • npm run build

🤖 Generated with Claude Code

Asana's API stores markdown verbatim as plaintext in notes/text, so
markdown written by callers of create_ticket/update_ticket/add_comment
was previously rendered literally instead of formatted. Add optional
description_html (tickets) and text_html (comments) parameters mapped
to Asana's html_notes/html_text fields, mutually exclusive with the
plain-text field, so callers can opt into rich formatting or
@-mentions without server-side markdown conversion.

Ref: CODE-1176
Docs alone don't reliably stop an agent from writing Markdown into
description/text out of habit. Add a lightweight heuristic
(looksLikeMarkdown) that flags headings, bold/italic, inline/fenced
code, links, and blockquotes (deliberately not dash-bulleted lists,
since those still read fine unconverted), and surface a warning in
the mutation result nudging the caller toward description_html/
text_html instead. The write still succeeds; this is a same-turn
corrective nudge, not a rejection.
@antonisobkowicz-asana
antonisobkowicz-asana merged commit a82ed1f into main Sep 4, 2026
3 checks passed
@antonisobkowicz-asana
antonisobkowicz-asana deleted the code-1176-html-notes branch September 4, 2026 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants