fix: prevent # symbols in code blocks from being treated as headers in explode command#8
fix: prevent # symbols in code blocks from being treated as headers in explode command#8halso wants to merge 2 commits intoksylvan:mainfrom
Conversation
…o gitignore - All changes except .gitignore generated by automatic formatting and linting tools - Apply Prettier formatting to JSON and markdown files (2-space indentation) - Add newline at end of index.js - Manually add CLAUDE.md to .gitignore for AI assistant workspace analysis - No functional changes, only automated formatting adjustments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
…n explode command Fixes issue ksylvan#7 where the explode command would incorrectly truncate sections when encountering # symbols inside code blocks. Now tracks code block boundaries and skips header detection when inside code blocks. Closes ksylvan#7 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
ksylvan
left a comment
There was a problem hiding this comment.
A lot of this seems like formatting changes - please reduce this diff to just the functional changes and keep my formatting choices.
Also, please squash your commits into 1.
|
@ksylvan - you're right. They shouldn't be mixed in. The formatting changes were done by the tools automatically when I ran your instructions at: https://github.com/ksylvan/markdown-tree-parser/blob/main/CONTRIBUTING.md#before-submitting
so I wanted to keep them separate from the actual bug commit. I'm guessing the correct thing to do then is:
Sorry for the confusion. It's my first time doing a Pull Request and also wasn't sure what the best thing was to do (and didn't want to create lots of different GitHub issues). |
Maybe just apply the first commit of this pull request: c32cfad The markdown-tree-parser is definitely buggy without this fix. |
|
I'll take care of this today. Thank you for finding the bug. |
|
Fixed in #9 |

Summary
explodecommand would incorrectly truncate sections when encountering#symbols inside code blocksProblem
The
explodecommand was treating#symbols inside code blocks (like bash comments) as markdown headers, causing sections to be truncated prematurely.Solution
Added code block state tracking:
Commits in this PR
chore: apply automatic formatting/linting changes and add CLAUDE.md to gitignore
fix: prevent # symbols in code blocks from being treated as headers in explode command
Test plan
npm test)npm run lint)npm run format)npm run test:cli)Closes #7
🤖 Generated with Claude Code