fix (sidebar): escape css for path selection

This commit is contained in:
MickaelK 2025-09-03 00:17:35 +10:00
parent 11c4a74f97
commit 13f926fc3b

View file

@ -20,7 +20,7 @@ export default async function ctrlNavigationPane(render, { $sidebar, path }) {
dirname, dirname,
}); });
if (cpath === "/") $fs.appendChild($ul); if (cpath === "/") $fs.appendChild($ul);
else qs($fs, `[data-path="${cpath}"] ul`).appendChild($ul); else qs($fs, `[data-path="${CSS.escape(cpath)}"] ul`).appendChild($ul);
} }
render($fs); render($fs);
@ -36,7 +36,7 @@ export default async function ctrlNavigationPane(render, { $sidebar, path }) {
return () => cleaners.map((fn) => fn()); return () => cleaners.map((fn) => fn());
}).pipe( }).pipe(
rxjs.tap(async(path) => { rxjs.tap(async(path) => {
const display = path === "/" ? render : createRender(qs($sidebar, `[data-path="${path}"] ul`)); const display = path === "/" ? render : createRender(qs($sidebar, `[data-path="${CSS.escape(path)}"] ul`));
display(await _createListOfFiles(path, {})); display(await _createListOfFiles(path, {}));
}), }),
)); ));