Skip to content

Commit

Permalink
Merge pull request #201 from GeoffreyChen777/electron-dev
Browse files Browse the repository at this point in the history
v2.1.5
  • Loading branch information
GeoffreyChen777 authored Jan 7, 2023
2 parents c5af4d5 + 1c6e14b commit 45bc388
Show file tree
Hide file tree
Showing 30 changed files with 147 additions and 73 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v2.1.5 07/01 2023

1. 优化 DBLP scaper 对部分 workshop 论文的检索结果。
2. 修复 BibTex 输出中一些特殊字符的问题。
3. 修复一些 Bug。

## v2.1.4 31/12 2022

1. 修复 Bug。
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v2.1.5 Jan 07 2023

1. Enhance the DBLP scaper for some workshop papers.
2. Fixed the bibtex output for special char.
3. Fixed some bugs

## v2.1.4 Dec 31 2022

1. Enhance the DBLP scaper for ICLR 2016.
Expand Down
2 changes: 2 additions & 0 deletions app/renderer/ui/app-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,12 @@ watch(
);
window.appInteractor.registerMainSignal("window-lost-focus", (_: any) => {
viewState.mainViewFocused = false;
void window.appInteractor.pauseSync();
});
window.appInteractor.registerMainSignal("window-gained-focus", (_) => {
viewState.mainViewFocused = true;
void window.appInteractor.resumeSync();
});
Expand Down
3 changes: 3 additions & 0 deletions app/renderer/ui/main-view/data-view/paper-data-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ const resetTableTitleColumns = (reset = false) => {
};
const onTableTitleClicked = (key: string) => {
if (key === "tags" || key === "folders") {
return;
}
prefState.mainviewSortBy = key;
prefState.mainviewSortOrder =
prefState.mainviewSortOrder === "asce" ? "desc" : "asce";
Expand Down
5 changes: 5 additions & 0 deletions app/renderer/ui/main-view/main-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ window.appInteractor.registerMainSignal("shortcut-Preference", () => {
window.appInteractor.registerMainSignal("shortcut-Enter", () => {
if (
viewState.mainViewFocused &&
!viewState.inputFieldFocused &&
(selectedPaperEntities.value.length >= 1 ||
selectedFeedEntities.value.length >= 1) &&
Expand All @@ -369,6 +370,7 @@ window.appInteractor.registerMainSignal("shortcut-Enter", () => {
window.appInteractor.registerMainSignal("shortcut-Space", () => {
if (
viewState.mainViewFocused &&
!viewState.inputFieldFocused &&
selectedPaperEntities.value.length >= 1 &&
!viewState.isDeleteConfirmShown &&
Expand All @@ -380,6 +382,9 @@ window.appInteractor.registerMainSignal("shortcut-Space", () => {
});
function preventSpaceArrowScrollEvent(event: KeyboardEvent) {
if (!viewState.mainViewFocused) {
return true;
}
if (
event.code === "Space" ||
event.code === "ArrowDown" ||
Expand Down
6 changes: 3 additions & 3 deletions app/renderer/ui/whats-new-view/whats-new-view-cn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ onMounted(() => {
v-else
/>
<p class="text-center text-2xl font-bold mb-8">
Paperlib 2.1.4 更新内容
Paperlib 2.1.5 更新内容
</p>

<ul class="list-disc mb-5">
<li>优化 DBLP scaper 对 ICLR 2016 的检索结果。</li>
<li>优化 DBLP scaper 对部分 workshop 论文的检索结果。</li>
<li>修复 BibTex 输出中一些特殊字符的问题。</li>
<li>修复一些 Bug。</li>
<li>新年快乐!</li>
</ul>
<div
id="whats-new-close-btn"
Expand Down
8 changes: 4 additions & 4 deletions app/renderer/ui/whats-new-view/whats-new-view-en.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ onMounted(() => {
v-else
/>
<p class="text-center text-2xl font-bold mb-8">
What's New in Paperlib 2.1.4
What's New in Paperlib 2.1.5
</p>

<ul class="list-disc mb-5">
<li>Enhance the DBLP scaper for ICLR 2016.</li>
<li>Fixed some bugs.</li>
<li>Happy New Year!</li>
<li>Enhance the DBLP scaper for some workshop papers.</li>
<li>Fixed the bibtex output for special char.</li>
<li>Fixed some bugs</li>
</ul>
<div
id="whats-new-close-btn"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ export class SemanticScholarDownloader extends Downloader {
for (const item of itemList) {
const plainHitTitle = formatString({
str: item.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});

const existTitle = formatString({
str: paperEntityDraft!.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});
Expand Down
9 changes: 7 additions & 2 deletions app/repositories/reference-repository/reference-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import { Preference } from "@/preference/preference";
import { MainRendererStateStore } from "@/state/renderer/appstate";
import { formatString } from "@/utils/string";

function escapeLaTexString(str: string) {
const out = str.replaceAll("&", "\\&").replaceAll("%", "\\%").replaceAll("$", "\\$").replaceAll("#", "\\#");
return out
}

export class ReferenceRepository {
stateStore: MainRendererStateStore;
preference: Preference;
Expand Down Expand Up @@ -49,7 +54,7 @@ export class ReferenceRepository {
for (const word of titleArray) {
if (
word.toLocaleLowerCase() !== "the" ||
word.toLocaleLowerCase() !== "a"
word.toLocaleLowerCase() !== "a" || word.toLocaleLowerCase() !== "an" || word.length <= 3
) {
citeKey += formatString({
str: word.toLowerCase(),
Expand Down Expand Up @@ -159,7 +164,7 @@ export class ReferenceRepository {
}

exportBibTexBody(cite: Cite): string {
return cite.format("bibtex");
return escapeLaTexString(cite.format("bibtex"));
}

async exportPlainText(cite: Cite): Promise<string> {
Expand Down
1 change: 1 addition & 0 deletions app/repositories/scraper-repository/scraper-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ export class ScraperRepository {
});
this.scraperList.push({
name: "dblp-venue",
// @ts-ignore
scraper: dblpVenueScraper,
});
} else if (scraperPref.name === 'biomedrxiv') {
Expand Down
4 changes: 2 additions & 2 deletions app/repositories/scraper-repository/scrapers/adsabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export class AdsabsScraper extends Scraper {
for (const item of parsedResponse.response.docs) {
const plainHitTitle = formatString({
str: item.title.join(" - "),
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});

const existTitle = formatString({
str: paperEntityDraft.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});
Expand Down
4 changes: 2 additions & 2 deletions app/repositories/scraper-repository/scrapers/chemrxiv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export class ChemRxivScraper extends Scraper {
for (const response of chemRxivResponses) {
const plainHitTitle = formatString({
str: response.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});

const existTitle = formatString({
str: paperEntityDraft.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ export class CitationCountScraper extends Scraper {
for (const item of itemList) {
const plainHitTitle = formatString({
str: item.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});

const existTitle = formatString({
str: paperEntityDraft.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});
Expand Down
4 changes: 2 additions & 2 deletions app/repositories/scraper-repository/scrapers/crossref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ export class CrossRefScraper extends Scraper {
for (const item of hitItems.items) {
const plainHitTitle = formatString({
str: item.title[0],
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});

const existTitle = formatString({
str: paperEntityDraft.title,
removeStr: "&amp",
removeStr: "&amp;",
removeSymbol: true,
lowercased: true,
});
Expand Down
Loading

0 comments on commit 45bc388

Please sign in to comment.