Skip to content

Fix heading with bold text producing malformed output#11

Merged
thesmallstar merged 1 commit intomainfrom
fix/heading-bold-malformed-output
Mar 2, 2026
Merged

Fix heading with bold text producing malformed output#11
thesmallstar merged 1 commit intomainfrom
fix/heading-bold-malformed-output

Conversation

@thesmallstar
Copy link
Owner

Summary

  • Fixes Bug: Heading with bold text produces malformed output #10 — headings containing bold text (e.g. ### **Step 1**: Description here) produced malformed Slack mrkdwn output like **Step 1*: Description here*
  • Both headings and bold map to * in Slack mrkdwn, so nested bold inside a heading creates duplicate/mismatched * markers
  • Suppresses strong_open/strong_close markers when inside a heading context, since the heading wrapper already provides bold formatting

Before / After

Markdown Before (broken) After (fixed)
### **Step 1**: Description here **Step 1*: Description here* *Step 1: Description here*
### **Step 1** **Step 1** *Step 1*
# **Test**: text **Test*: text* *Test: text*

Test plan

  • Added test_heading_with_bold covering all 3 reproduction cases from the issue
  • All 48 tests pass (47 existing + 1 new)
  • Verified standalone bold (**Bold***Bold*) still works correctly

🤖 Generated with Claude Code

Both headings and bold map to `*` in Slack mrkdwn. When bold text
appears inside a heading, the nested `*` markers produce malformed
output like `**Step 1*: Description here*` instead of the correct
`*Step 1: Description here*`.

Suppress bold markers inside headings since the heading wrapper
already provides bold formatting, making nested bold redundant.

Fixes #10

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@thesmallstar thesmallstar merged commit 74b7f3a into main Mar 2, 2026
7 checks passed
@thesmallstar thesmallstar mentioned this pull request Mar 2, 2026
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.

Bug: Heading with bold text produces malformed output

1 participant