[Archived] Archived WIP of vielle.dev

Fix accessibility issue with custom markdown

vielle.dev 012421b8 7a36c5fc

verified
+2 -1
+2 -1
rehype-custom-html.ts
··· 54 54 55 55 // match section before | 56 56 const prefixes = alt.match(/.*?(?= \|.*)/gm); 57 + if (!prefixes) return; 58 + 57 59 node.properties.alt = alt.match(/(?<= \| ).*/gm); 58 - if (!prefixes) return; 59 60 const flags = prefixes[0].split(" "); 60 61 for (const flag of flags) { 61 62 node.properties[`data-img-flag--${flag}`] = true;