Skip to content

Commit

Permalink
Search for the exact match first
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitrySharabin committed Aug 21, 2024
1 parent 1a9c590 commit 9c6bc47
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/import/biblatex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -952,13 +952,22 @@ export class BibLatexParser {
}
}

let bibType = Object.keys(BibTypes).find((bType) => {
return (
BibTypes[bType]["biblatex"] === biblatexType &&
(!biblatexSubtype ||
BibTypes[bType]["biblatex-subtype"] === biblatexSubtype)
)
})
let bibType
if (
biblatexType in BibTypes &&
(!biblatexSubtype ||
BibTypes[biblatexType]["biblatex-subtype"] === biblatexSubtype)
) {
bibType = biblatexType
} else {
bibType = Object.keys(BibTypes).find((bType) => {
return (
BibTypes[bType]["biblatex"] === biblatexType &&
(!biblatexSubtype ||
BibTypes[bType]["biblatex-subtype"] === biblatexSubtype)
)
})
}

if (typeof bibType === "undefined") {
this.warning({
Expand Down

0 comments on commit 9c6bc47

Please sign in to comment.