Skip to content

Commit

Permalink
fix: handle some file name fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu committed Dec 4, 2024
1 parent 97936f8 commit ac20e01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/parser/DeckParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ export class DeckParser {
deckName ||
dom('title').text() ||
this.getFirstHeadingText(dom) ||
fileName ||
'Default',
this.extractPageIcon(dom),
decks.length
Expand Down
2 changes: 1 addition & 1 deletion src/lib/parser/experimental/FallbackParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class FallbackParser {
deckName = this.getTitleMarkdown(contents);
} else if (isCSVFile(file.name)) {
const csv = new TextDecoder().decode(file.contents as Uint8Array);
deckName = 'Default';
deckName = file.name ?? 'Default';
cards = getCardsFromCSV(csv) as Note[];
clean = false;
}
Expand Down

0 comments on commit ac20e01

Please sign in to comment.