Skip to content

Commit

Permalink
fix: more accurate DOM parsing for NPMJS which resolves navigation du…
Browse files Browse the repository at this point in the history
…ring brower history buttons (#105)

Signed-off-by: Paul Horton <phorton@sonatype.com>
  • Loading branch information
madpah committed Oct 16, 2023
1 parent 75b9420 commit 36a6f87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/PageParsing/NPM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const parseNPM = (url: string): PackageURL | undefined => {
const pathResult = repoType.pathRegex.exec(url.replace(repoType.url, ''))
console.debug(pathResult?.groups)
if (pathResult && pathResult.groups) {
console.debug(`"${stripHtmlComments($(repoType.versionDomPath).text())}"`)
const pageVersion = stripHtmlComments($(repoType.versionDomPath).text()).split('•')[0].trim()
console.debug(`"${stripHtmlComments($(repoType.versionDomPath).first().text())}"`)
const pageVersion = stripHtmlComments($(repoType.versionDomPath).first().text()).split('•')[0].trim()

return generatePackageURLWithNamespace(
FORMATS.npm,
Expand Down

0 comments on commit 36a6f87

Please sign in to comment.