最近终于有时间了,于是读了一下 vscode 1.89 版本的更新,发现它引用了一个非常有用的功能—— markdown.experimental.updateLinksOnPaste
。
废话不多说,当我们开启该功能有什么用呢?下面是一个案例:
首先,我们在 settings.json
中开启该配置。
{
"markdown.experimental.updateLinksOnPaste": true
}
然后准备一段 md 测试文本,比如这样:
# 测试
1. 请参考 [详见官方案例参考][ref1]。
2. [读写文件][ref2]
[ref1]: https://github.com/microsoft/vscode-extension-samples/tree/main/esbuild-sample
[ref2]: https://docs.deno.com/runtime/tutorials/read_write_files
现在,我们只复制第三行内容,也就是:
1. 请参考 [详见官方案例参考][ref1]。
接着,粘贴到另一个 markdown 文件中,我们会发现,vscode 自动帮我们处理了 ref1
这一引用路径!
1. 请参考 [详见官方案例参考][ref1]。
[ref1]: https://github.com/microsoft/vscode-extension-samples/tree/main/esbuild-sample
爽!