microsoft / vscode-docs-authoring

VSCode extension that provides markdown authoring assistance to docs.microsoft.com contributors
MIT License
138 stars 97 forks source link

Automatically convert images to new format #934

Open MashaMSFT opened 1 year ago

MashaMSFT commented 1 year ago

It'd be cool if, as a right-click menu option, we could easily convert all images on a doc to the new format.

Like, in this menu: image

Add a "convert images to new format" option, which essentially, runs this regex:

#Find images in Markdown format like ![ ]( )
!\[(.+)\]\((.+)\)

#Replace with new format
:::image type="content" source="$2" alt-text="$1":::

more info here: https://review.learn.microsoft.com/en-us/help/contribute/contribute-how-to-create-screenshot?branch=main#converting-from-standard-image-syntax-to-learn-image-syntax

thanks!