13 lines
242 B
JavaScript
13 lines
242 B
JavaScript
function convertPathToHtml(path) {
|
|
let htmlpath = ''
|
|
while (path.startsWith('../')) {
|
|
path = path.slice(3)
|
|
if (htmlpath.length < 2) htmlpath += '.'
|
|
else htmlpath += '/..'
|
|
}
|
|
|
|
return htmlpath
|
|
}
|
|
|
|
export { convertPathToHtml }
|