Skip to content

Added regex capture groups support for slug in targetPath and linkPattern#149

Merged
telesoho merged 2 commits intotelesoho:masterfrom
lagthedark:fix-image-path
Feb 27, 2026
Merged

Added regex capture groups support for slug in targetPath and linkPattern#149
telesoho merged 2 commits intotelesoho:masterfrom
lagthedark:fix-image-path

Conversation

@lagthedark
Copy link

I added support for regex capture groups in MarkdownPaste.imageRules.

I needed it to use capture groups from the match regex in targetPath and linkPattern using $1, $2, etc.

"MarkdownPaste.imageRules": [
  {
    "match": "(.*)-example\\.md$",
    "targetPath": "${workspaceFolder}/images/$1/image.png",
    "linkPattern": "![${altText}](../images/$1/image.png)"
  }
]

I also updated the README.md to show this feature

@telesoho telesoho merged commit 9074a7a into telesoho:master Feb 27, 2026
3 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