Skip to content

fix(jira): stop prose plus signs corrupting markdown read-back - #1615

Open
barrygfox wants to merge 2 commits into
sooperset:mainfrom
barrygfox:pr/prose-plus-readback
Open

fix(jira): stop prose plus signs corrupting markdown read-back#1615
barrygfox wants to merge 2 commits into
sooperset:mainfrom
barrygfox:pr/prose-plus-readback

Conversation

@barrygfox

@barrygfox barrygfox commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Problem

Unpaired plus signs in Jira prose, especially version numbers such as Python 3.13+ and urllib3 2.6+, could be paired across text by the inserted-text rule. That emitted an <ins> tag, triggered whole-document HTML conversion, escaped existing Markdown characters, and removed the plus signs from read responses.

The HTML guard also checked content only after jira_to_markdown(). Converter-generated tags therefore still looked like source HTML, so the guard did not prevent the second conversion.

Solution

  1. Inserted-text delimiters adjacent to word characters are treated as prose: (?<!\w)\+([^+\n]+)\+(?!\w).
  2. clean_jira_text() records whether the original Jira source contains HTML outside protected code spans before Jira markup conversion.
  3. Whole-document HTML conversion runs only when HTML came from that original source. Tags emitted by Jira conversion remain valid inline HTML in the Markdown result.

Changes

  • src/mcp_atlassian/preprocessing/jira.py
    • Preserve unpaired version-number plus signs.
    • Detect source HTML without mistaking Jira or Markdown code spans for HTML.
    • Keep converter-generated <ins>, <cite>, <sup>, and <sub> tags from triggering a second conversion.
  • tests/unit/preprocessing/test_preprocessing.py
    • Cover stray plus signs alongside Markdown emphasis.
    • Cover literal plus signs in smart-link URLs.
    • Prove generated HTML does not trigger conversion, including when literal HTML appears inside a code span.
    • Preserve genuine inserted-text markup.

Verification

  • uv run pytest tests/unit/preprocessing/ -q: 175 passed
  • uv run pytest tests/unit/ -q: 3842 passed, 5 repository-standard skips
  • uv run pytest 'tests/e2e/test_jira_auth_matrix.py::TestJiraReadOperations::test_get_issue[basic]' --dc-e2e -vv: 1 passed, no skips
  • uv run python scripts/generate_tool_docs.py --check: passed
  • Ruff check and format check on changed Jira/test files: passed
  • mypy hook on changed Jira/test files: passed

A broader DC run reached 102 passed, 1 failed, and 1 skipped. The failure is an unrelated JSM fixture problem: the pre-seeded JSMDC-2 issue returns 403 from the service-desk comment endpoint.

Related: #1610

barrygfox and others added 2 commits August 25, 2026 10:36
Unpaired plus signs in prose (version numbers like 3.13+) were paired
by the inserted-text rule into an <ins> span spanning whole paragraphs.
The resulting HTML tag then triggered _convert_html_to_markdown, which
pushed the entire document through markdownify and escaped every
markdown emphasis delimiter in the response (rendered as \*\* in tool
output) while dropping the plus signs.

- inserted-text delimiters glued to word characters are now treated as
  prose, matching how Jira itself renders intraword pluses
- _convert_html_to_markdown only engages when the source text contained
  HTML, never merely because our own converter emitted a tag
- smart-link URLs keep literal plus signs; only display titles get them
  replaced with spaces
@barrygfox
barrygfox force-pushed the pr/prose-plus-readback branch from f1bc557 to 1864655 Compare August 25, 2026 02:38
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