Skip to content

Commit

Permalink
publication_list: remove all workaround to deal with bibtex to unicod…
Browse files Browse the repository at this point in the history
…e conversion

Enforcing pybtex>=0.20 since this version of pybtex can handle it for us.
  • Loading branch information
xuhdev committed Mar 11, 2016
1 parent 932dc50 commit 0d82b04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
15 changes: 2 additions & 13 deletions v7/publication_list/publication_list.py
Expand Up @@ -36,17 +36,6 @@
from pybtex.plugin import find_plugin


def process_bibtex_string(s):
"""
Process the BibTeX string to a Unicode string.
"""
# replace the special quote characters with the HTML version
s = s.replace("``", "\u201c").replace("''", "\u201d")
s = s.replace("`", "\u2018").replace("'", "\u2019")
s = s.replace("---", "\u2014")
return s


class Plugin(RestExtension):

name = "publication_list"
Expand Down Expand Up @@ -144,8 +133,8 @@ def run(self):
html += ' [<a href="{}">abstract and details</a>]'.format(
self.site.config['BASE_URL'] + page_url)
context = {
'title': process_bibtex_string(entry.fields['title']),
'abstract': process_bibtex_string(entry.fields['abstract']) if 'abstract' in entry.fields else '',
'title': entry.fields['title'],
'abstract': entry.fields['abstract'] if 'abstract' in entry.fields else '',
'bibtex': bib_data.to_string('bibtex'),
'bibtex_link': '/' + bib_link if bibtex_dir else '',
'default_lang': self.site.config['DEFAULT_LANG'],
Expand Down
2 changes: 1 addition & 1 deletion v7/publication_list/requirements.txt
@@ -1 +1 @@
pybtex
pybtex>=0.20

0 comments on commit 0d82b04

Please sign in to comment.