feat: command template csv

This commit is contained in:
2026-03-01 11:52:09 +08:00
parent aac7fe575a
commit 3e14bff1e9
2 changed files with 21 additions and 4 deletions
+11
View File
@@ -37,3 +37,14 @@ export function resolvePath(base: string, relative: string): string {
return '/' + baseParts.join('/');
}
export function loadElementSrc(element?: { textContent: string, closest: (arg0: string) => HTMLElement }){
const rawSrc = element?.textContent;
if(element) element.textContent = "";
const articleEl = element?.closest('article[data-src]');
const articlePath = articleEl?.getAttribute('data-src') || '';
return { articlePath, rawSrc };
}