Fixed the ampersand decoding problem.

This commit is contained in:
Homer S. 2022-01-27 13:42:56 +01:00
parent 6033eadec5
commit ed616698a8
1 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ class CitationPlugin(Plugin):
if len(lAuthor) > 1:
if n == (len(lAuthor) - 1):
authors += " \& "
authors += " & "
elif n < (len(lAuthor) -1):
authors += ", "
@ -77,7 +77,7 @@ class CitationPlugin(Plugin):
if len(lAuthor) > 1:
if n == (len(lAuthor) - 1):
authors += " \& "
authors += " & "
elif n < (len(lAuthor) -1):
authors += ", "
@ -240,7 +240,7 @@ class CitationPlugin(Plugin):
def on_setup_env(self, **extra):
def decode_filter(value):
""" Make sure that special chars like german umlaute or accents are displayed in unicode """
return LatexNodes2Text().latex_to_text(value)
return LatexNodes2Text().latex_to_text(value.replace(" & ", " \& "))
self.env.jinja_env.globals['citation_entries'] = self.citation_entries
self.env.jinja_env.globals['citation_entry'] = self.citation_entry