feat: command template csv
This commit is contained in:
@@ -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 };
|
||||
}
|
||||
Reference in New Issue
Block a user