TypeScript(sh)if [1 -gt 0]; then
echo "I'm TypeScript!"
fi
code:TypeScript(sh)
と記述しているので、タイトルはTypeScriptなのにsyntax highlightはshが適用されているdetectCodeBlockStart.jsexport const detectCodeBlockStart = (text) => {
const matches = text.match(/^\s*code:(.+)\(([^()]+)\)$/)
?? text.match(/^\s*code:(.+)$/);
if (!matches) return {};
const [, filename, lang] = matches;
return {
filename: filename.trim(),
lang: lang || filename.split(".").pop() ?? "",
};
};