MCPcopy Index your code
hub / github.com/ollm/OpenComic / returnTextPath

Function returnTextPath

scripts/dom.js:1299–1320  ·  view source on GitHub ↗
(path, mainPath, image = false, extension = true)

Source from the content-addressed store, hash-verified

1297}
1298
1299function returnTextPath(path, mainPath, image = false, extension = true)
1300{
1301 mainPathR = addSepToEnd(p.dirname(mainPath));
1302
1303 let files = path.replace(new RegExp('^\s*'+pregQuote(mainPathR)), '').split(p.sep);
1304 path = [];
1305
1306 let _path = mainPathR;
1307
1308 for(let i = 0, len = files.length; i < len; i++)
1309 {
1310 _path = p.normalize(p.join(_path, files[i]));
1311 files[i] = metadataPathName({path: _path, name: files[i]}, true);
1312
1313 if(!extension && i == len - 1)
1314 files[i] = p.parse(files[i]).name;
1315
1316 path.push(translatePageName(image ? htmlEntities(files[i]) : files[i]));
1317 }
1318
1319 return path.join(image ? '<i class="material-icon navegation">chevron_right</i>' : ' / ');
1320}
1321
1322var isFromLibrary = true;
1323

Callers 1

processReadingProgressFunction · 0.85

Calls 5

addSepToEndFunction · 0.85
pregQuoteFunction · 0.85
metadataPathNameFunction · 0.85
translatePageNameFunction · 0.85
htmlEntitiesFunction · 0.85

Tested by

no test coverage detected