@@ -508,7 +508,7 @@ export class LeafletRenderer extends MarkdownRenderChild {
508
508
) ;
509
509
let arr = Array . isArray ( f ) ? f : [ f ] ;
510
510
for ( let path of arr ) {
511
- var abstractFile , depth ;
511
+ let abstractFile , depth ;
512
512
( { abstractFile, path, depth } = this . filePathAndDepth (
513
513
path ,
514
514
sub
@@ -902,12 +902,12 @@ export class LeafletRenderer extends MarkdownRenderChild {
902
902
) {
903
903
let files = new Set ( markerFile ) ;
904
904
905
- var sub = this . sourcePath . substring (
905
+ const sub = this . sourcePath . substring (
906
906
0 ,
907
907
this . sourcePath . lastIndexOf ( "/" )
908
908
) ;
909
909
for ( let path of markerFolder ) {
910
- var abstractFile , depth ;
910
+ let abstractFile , depth ;
911
911
( { abstractFile, path, depth } = this . filePathAndDepth (
912
912
path ,
913
913
sub
@@ -1318,10 +1318,9 @@ export class LeafletRenderer extends MarkdownRenderChild {
1318
1318
1319
1319
private filePathAndDepth ( path : string , sub : string ) {
1320
1320
if ( path [ 0 ] == "." ) {
1321
- var rest = path . substring ( 1 ) ;
1322
- path = sub + rest ;
1321
+ path = sub + path . substring ( 1 ) ;
1323
1322
}
1324
- var depth = 2 ;
1323
+ let depth = path . endsWith ( "/" ) ? 2 : Infinity ;
1325
1324
while ( path . endsWith ( "/" ) ) {
1326
1325
path = path . substring ( 0 , path . length - 1 ) ;
1327
1326
++ depth ;
@@ -1381,7 +1380,11 @@ export class LeafletRenderer extends MarkdownRenderChild {
1381
1380
try {
1382
1381
convertedLatitude = Number ( `${ latitude } ` ?. split ( "%" , 1 ) [ 0 ] ) ;
1383
1382
} catch ( error ) {
1384
- new Notice ( t ( "There was an error with the provided latitude. Using default." ) ) ;
1383
+ new Notice (
1384
+ t (
1385
+ "There was an error with the provided latitude. Using default."
1386
+ )
1387
+ ) ;
1385
1388
}
1386
1389
if ( ! isNaN ( convertedLatitude ) ) {
1387
1390
coords [ 0 ] = convertedLatitude ;
@@ -1393,7 +1396,11 @@ export class LeafletRenderer extends MarkdownRenderChild {
1393
1396
try {
1394
1397
convertedLongitude = Number ( `${ longitude } ` ?. split ( "%" , 1 ) [ 0 ] ) ;
1395
1398
} catch ( error ) {
1396
- new Notice ( t ( "There was an error with the provided longitude. Using default." ) ) ;
1399
+ new Notice (
1400
+ t (
1401
+ "There was an error with the provided longitude. Using default."
1402
+ )
1403
+ ) ;
1397
1404
}
1398
1405
if ( ! isNaN ( convertedLongitude ) ) {
1399
1406
coords [ 1 ] = convertedLongitude ;
0 commit comments