python lexer misses unicode docstrings

Issue #489 resolved
Anonymous created an issue

In the lexer for the Python language, you interpret triple quoted strings with no preceeding text (except whitespace) as docstrings, but you forgot to allow for the possibility that such a docstring might be a unicode string with a leading "u". I therefore suggest that you replace lines 46 and 47 within pygments/lexers/agile.py like this:

{{{

(r'^(\s)("""(?:.|\n)?""")', bygroups(Text, String.Doc)),

(r"^(\s)('''(?:.|\n)?''')", bygroups(Text, String.Doc)),

(r'^(\s)([uU]?"""(?:.|\n)?""")', bygroups(Text, String.Doc)), (r"^(\s)([uU]?'''(?:.|\n)?''')", bygroups(Text, String.Doc)), }}}

Thanks for an otherwise awesome package.

Reported by guest

Comments (4)

  1. Log in to comment