vscode markdown preview enhanced plugin show image alt title description
edit parser.js file‘s onWillParseMarkdown
OR onDidParseMarkdown
function:
- windows:%userprofile%/.crossnote/parser.js
- linux/mac:~/.crossnote/parser.js
for old version:
- windows:%userprofile%/.mume/parser.js
- linux/mac:~/.mume/parser.js
onWillParseMarkdown: async function(markdown) {
markdown = markdown.replace(/!\[(.*?)\]\((.*?)\)/g, (all,alt,src) => `${all}<span style="margin-top:-5px;text-decoration: underline;text-underline-offset:2px;text-decoration-color:#d9d9d9;font-size:13px;text-align:center;display:block;">${alt}</span>`);
return markdown;
},
onDidParseMarkdown: async function(html) {
html = html.replace(/<img src="(.*?)" alt="(.*?)".*?>/g, (all,src,alt) => `${all}<span style="margin-top:-5px;text-decoration: underline;text-underline-offset:2px;text-decoration-color:#d9d9d9;font-size:13px;text-align:center;display:block;">${alt}</span>`);
return html;
},