Skip to content

Commit

Permalink
Fixed formatting and linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kliput committed Aug 7, 2023
1 parent b9d4ffe commit 18cce3a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/find/find-references.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ const imageExtensions = Object.freeze([
'svg',
'tiff',
'webp',
'xbm',
]);
'xbm'
])

const imagePathRegexp = new RegExp(
`^(.*\/)?[^#]+\.(${imageExtensions.join('|')})(#.*|$)`
);
`^(.*/)?[^#]+\\.(${imageExtensions.join('|')})(#.*|$)`
)

/**
* @param {{tree: Root, file: VFile, fileSet?: FileSet, options: Options}} ctx
Expand Down Expand Up @@ -238,7 +238,7 @@ export async function findReferences(ctx) {
function urlToPath(value, config, type) {
// Ignore "headings" in image links: `image.png#metadata`
if (isImagePath(value)) {
value = stripHash(value);
value = stripHash(value)
}

// Absolute paths: `/wooorm/test/blob/main/directory/example.md`.
Expand Down Expand Up @@ -374,17 +374,17 @@ function readme(filePath) {
}

/**
*
* @param {string} path
*
* @param {string} path
* @returns {boolean}
*/
function isImagePath(path) {
return imagePathRegexp.test(path);
return imagePathRegexp.test(path)
}

/**
* @param {string} path
* @param {string} path
*/
function stripHash(path) {
return path.replace(/^(.*?)(#.*)$/, '$1');
return path.replace(/^(.*?)(#.*)$/, '$1')
}

0 comments on commit 18cce3a

Please sign in to comment.