Skip to content
Permalink
Browse files
publication_list: Correctly highlight authors with middle names.
Fix #259
  • Loading branch information
xuhdev committed Mar 14, 2018
1 parent d70b21e commit c37ef1fdfeb3e1b7ef5cd19303230b916050d9c0
Showing with 5 additions and 1 deletion.
  1. +5 −1 v7/publication_list/publication_list.py
@@ -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 = ""

0 comments on commit c37ef1f

Please sign in to comment.