Add remaining samples, tooling, and local project assets

This commit is contained in:
2026-04-15 18:02:17 +09:00
parent 05d43a7999
commit 1ff6c6cbb2
862 changed files with 18979 additions and 21 deletions

View File

@@ -0,0 +1,22 @@
// /src/utils/markdownUtils.js
const imageCache = new Map();
export function resolveImagePath(src) {
if (!src) return src;
if (src.startsWith("@img/")) {
return src.replace("@img/", "/civil-engineering-lab/images/");
}
if (src.startsWith("../assets/images/")) {
return src.replace("../assets/images/", "/civil-engineering-lab/images/");
}
return src;
}
/**
* href가 외부 링크인지 확인
* - http://, https://, // 로 시작하면 외부 링크로 판단
*/
export function isExternalLink(href) {
if (!href) return false;
return /^https?:\/\//.test(href) || href.startsWith("//");
}