Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswilm committed Mar 13, 2024
1 parent bcfff66 commit 914a855
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ fiduswriter/.coveragerc
fiduswriter/configuration.py
fiduswriter/fiduswriter.sql
fiduswriter/screenshots
.transpile/
static-libs/
fiduswriter.sql
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ export const searchApiResultCrossrefTemplate = ({items}) => {
<th>${gettext("Abstract")}</th>
</tr>` +
items.map(item => {
const publishedDate = item.published && item.published['date-parts'] ? item.published['date-parts'].map(part => part.join("-")).join(", ") : ""
const abstractWithoutHTML = item.abstract ? item.abstract.replace(/<[^>]*>?/gm, '') : ""
const publishedDate = item.published && item.published["date-parts"] ? item.published["date-parts"].map(part => part.join("-")).join(", ") : ""
const abstractWithoutHTML = item.abstract ? item.abstract.replace(/<[^>]*>?/gm, "") : ""
return `<tr class="item">
<td><button type="button" class="api-import fw-button fw-orange fw-small"
data-doi="${item.DOI}">
Expand All @@ -203,7 +203,7 @@ export const searchApiResultCrossrefTemplate = ({items}) => {
abstractWithoutHTML.length ?
`<p>
${
abstractWithoutHTML.length < 200 ?
abstractWithoutHTML.length < 200 ?
escapeText(abstractWithoutHTML) :
escapeText(abstractWithoutHTML.substring(0, 200)) + "..."
}
Expand All @@ -212,5 +212,5 @@ export const searchApiResultCrossrefTemplate = ({items}) => {
}
</td>
</tr>`
}).join("") + "</table>"
}).join("") + "</table>"
}
4 changes: 3 additions & 1 deletion fiduswriter/citation_api_import/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ async def proxy(request, url):
response = await client.get(
url,
headers={
"User-Agent": request.META.get("HTTP_USER_AGENT", "Fidus Writer"),
"User-Agent": request.META.get(
"HTTP_USER_AGENT", "Fidus Writer"
),
"Referer": request.META.get("HTTP_REFERER", ""),
"Accept": request.META.get("HTTP_ACCEPT", "application/json"),
},
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def find_package_modules(self, package, package_dir):
setup(
packages=find_namespace_packages(),
include_package_data=True,
exclude_package_data={"": ["configuration.py", "django-admin.py", "build/*"]},
exclude_package_data={
"": ["configuration.py", "django-admin.py", "build/*"]
},
cmdclass={"build_py": build_py},
)

0 comments on commit 914a855

Please sign in to comment.