Skip to content

Commit

Permalink
Fix absolute reference links with anchor
Browse files Browse the repository at this point in the history
  • Loading branch information
mcs07 committed Nov 1, 2016
1 parent e4c28ff commit 528c37e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions chemdataextractor/reader/markup.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,8 @@ def _parse_table_footnotes(self, fns, refs, specials):

def _parse_reference(self, el):
"""Return reference ID from href or text content."""
if el.get('href', '').startswith('#'):
# TODO: Get anchor from href with absolute url, e.g. http://pubs.acs.org/doi/full/10.1021/acs.jmedchem.6b01195#cor1
return [el.get('href')[1:]]
if '#' in el.get('href', ''):
return [el.get('href').split('#', 1)[1]]
elif 'rid' in el.attrib:
return [el.attrib['rid']]
elif 'idref' in el.attrib:
Expand Down

0 comments on commit 528c37e

Please sign in to comment.