diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index f485c3fe..3182a544 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -71,7 +71,10 @@ class Pygments(Directive): if flag in self.options: self.options[flag] = True - self.options['linespans'] += next(code_block_id) + if '' in self.options['linespans']: + self.options['linespans'] = str(self.options['linespans']).replace( + '', next(code_block_id) + ) # noclasses should already default to False, but just in case... formatter = HtmlFormatter(noclasses=False, **self.options)