Ticket descriptions are not rendered as markdown in the ticket view #114

Open
opened 2026-10-06 22:45:59 -04:00 by jared · 0 comments
Owner

Problem

Ticket descriptions show raw markdown on the ticket page: ## headings, - [ ] checklists, **bold** and `code` all appear literally. Comments with markdown enabled render correctly.

This now happens often, because the MCP create_ticket tool says descriptions support markdown and Claude-created tickets use it. Example: ticket 887531976.

Cause

renderDescriptionView() in assets/js/ticket.js (lines 84-96 on main) always renders the description as escaped plain text:

// Ticket descriptions are plain text. CSS white-space:pre-wrap handles
// line breaks and multiple spaces (ASCII art) — no <br> replacement needed.
viewDiv.innerHTML = lt.escHtml(raw);

#ticketDescriptionView (views/TicketView.php:429-431) already has the lt-markdown class, and markdown.js is already loaded (views/TicketView.php:17). Only the render call bypasses parseMarkdown().

Suggested fix

  • Render the description with parseMarkdown(raw), which already sanitises HTML, just as comments do.
  • Keep plain-text rendering for older tickets that rely on pre-wrap layout, such as hwmonDaemon ASCII tables. Two options:
    • store a markdown_enabled flag per ticket (like comments), defaulting to on for UI and MCP tickets; or
    • render markdown only when the text contains markdown syntax.
  • Bring the MCP tool description (create_ticket → "markdown supported") and the API docs in line with whichever behaviour is chosen.
  • Check the dashboard and list views (DashboardView.php also loads markdown.js) for any description excerpt or preview that needs the same treatment.

Acceptance

  • A ticket whose description contains ## Heading, - [ ] item and **bold** shows a formatted heading, a checklist and bold text in the read view.
  • hwmonDaemon tickets with fixed-width tables still keep their alignment.
  • The edit view still shows the raw markdown source.
## Problem Ticket descriptions show raw markdown on the ticket page: `##` headings, `- [ ]` checklists, `**bold**` and `` `code` `` all appear literally. Comments with markdown enabled render correctly. This now happens often, because the MCP `create_ticket` tool says descriptions support markdown and Claude-created tickets use it. Example: ticket 887531976. ## Cause `renderDescriptionView()` in `assets/js/ticket.js` (lines 84-96 on `main`) always renders the description as escaped plain text: ```js // Ticket descriptions are plain text. CSS white-space:pre-wrap handles // line breaks and multiple spaces (ASCII art) — no <br> replacement needed. viewDiv.innerHTML = lt.escHtml(raw); ``` `#ticketDescriptionView` (`views/TicketView.php:429-431`) already has the `lt-markdown` class, and `markdown.js` is already loaded (`views/TicketView.php:17`). Only the render call bypasses `parseMarkdown()`. ## Suggested fix - Render the description with `parseMarkdown(raw)`, which already sanitises HTML, just as comments do. - Keep plain-text rendering for older tickets that rely on `pre-wrap` layout, such as hwmonDaemon ASCII tables. Two options: - store a `markdown_enabled` flag per ticket (like comments), defaulting to on for UI and MCP tickets; or - render markdown only when the text contains markdown syntax. - Bring the MCP tool description (`create_ticket` → "markdown supported") and the API docs in line with whichever behaviour is chosen. - Check the dashboard and list views (`DashboardView.php` also loads `markdown.js`) for any description excerpt or preview that needs the same treatment. ## Acceptance - A ticket whose description contains `## Heading`, `- [ ] item` and `**bold**` shows a formatted heading, a checklist and bold text in the read view. - hwmonDaemon tickets with fixed-width tables still keep their alignment. - The edit view still shows the raw markdown source.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/tinker_tickets#114