Created
May 12, 2023 16:04
-
-
Save tayiorbeii/96c61076fa737407feceb235404635a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "@johnlindquist/kit" | |
| // Author: Taylor Bell | |
| // Name: replace-markdown-image-tag | |
| // Description: Reformat a markdown image tag to be a placeholder | |
| let allFiles = await drop() | |
| for (let file of allFiles) { | |
| let content = await readFile(file.path, "utf-8") | |
| let newContent = content.replace(/\!\[.*?\]\((https:\/\/file%2B\.vscode-resource\.vscode-cdn\.net\/.*\/(images-.+?))\)/g, '<img src="./$2" width="720">') | |
| await writeFile(file.path, newContent) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment