Skip to content

Fix parseImageInput to handle shell-escaped \! in markdown image refs#22

Merged
simonw merged 1 commit intomainfrom
claude/recreate-explain-error-tND29
Feb 23, 2026
Merged

Fix parseImageInput to handle shell-escaped \! in markdown image refs#22
simonw merged 1 commit intomainfrom
claude/recreate-explain-error-tND29

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Feb 23, 2026

IMG_2094

Recreate and explain the error

Some shells escape "!" to "\!" even in single-quoted strings, causing
the markdown image reference parser to fail to recognize the ![alt](path)
syntax. The entire escaped string was then treated as a file path,
producing the error "image file not found: \![alt text](path)".

Strip the leading backslash when the input starts with \![ before
attempting to parse as a markdown image reference.

https://claude.ai/code/session_01BqcPiZ39GE4j4ZhvHVFyZ8

Some shells escape "!" to "\!" even in single-quoted strings, causing
the markdown image reference parser to fail to recognize the ![alt](path)
syntax. The entire escaped string was then treated as a file path,
producing the error "image file not found: \![alt text](path)".

Strip the leading backslash when the input starts with \![ before
attempting to parse as a markdown image reference.

https://claude.ai/code/session_01BqcPiZ39GE4j4ZhvHVFyZ8
@simonw simonw merged commit d531261 into main Feb 23, 2026
2 checks passed
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.

2 participants