Skip to content

Commit

Permalink
Merge pull request #133 from DmitrySharabin/biblatex-bibtype
Browse files Browse the repository at this point in the history
When calculating `bibType`, consider the exact match first
  • Loading branch information
johanneswilm authored Aug 28, 2024
2 parents 1a9c590 + 9c6bc47 commit 0373496
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 0373496

Please sign in to comment.