Skip to content

Commit

Permalink
publication_list: Correctly highlight authors with middle names.
Browse files Browse the repository at this point in the history
Fix #259
  • Loading branch information
xuhdev committed Mar 14, 2018
1 parent d70b21e commit c37ef1f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion v7/publication_list/publication_list.py
Expand Up @@ -126,8 +126,12 @@ def run(self):
pub_html = list(style.format_entries((entry,)))[0].text.render_as('html')
if highlight_authors: # highlight one of several authors (usually oneself)
for highlight_author in highlight_authors:
# We need to replace all occurrence of space except for the last one with
#  , since pybtex does it for all authors
count = highlight_author.count(' ') - 1
pub_html = pub_html.replace(
highlight_author.strip(), '<strong>{}</strong>'.format(highlight_author), 1)
highlight_author.strip().replace(' ', '&nbsp;', count),
'<strong>{}</strong>'.format(highlight_author), 1)
html += '<li class="publication" style="padding-bottom: 1em;">' + pub_html

extra_links = ""
Expand Down

0 comments on commit c37ef1f

Please sign in to comment.