Skip to content

Commit

Permalink
Merge branch 'release/1.0.12'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhigman committed Jul 24, 2024
2 parents 0a609fe + e362261 commit a14bee6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
beautifulsoup4==4.11.2
thothlibrary==0.17.0
thothlibrary==0.26.0
lxml==4.9.2
6 changes: 4 additions & 2 deletions src/epublius/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,15 @@ def get_chapter_title(self):

def get_chapter_doi(self):
'''
Retrieve chapter DOI based on the text of <p class=doi>
Retrieve chapter DOI based on the text of <p class="doi">
(this contains both copyright statement and DOI link)
'''
# Not all chapters will have DOIs
doi = None

doi_node = self.soup.find('p', class_='doi')
# Class string may not exactly match "doi" if an override has been implemented
# (e.g. `<p class="doi ParaOverride-9">`)
doi_node = self.soup.find('p', class_=lambda L: L and 'doi' in L.split())

if (doi_node is not None):
# In the case where multiple <a> elements are present,
Expand Down

0 comments on commit a14bee6

Please sign in to comment.