diff options
author | Tim Hatch <tim@timhatch.com> | 2010-12-21 22:34:20 -0800 |
---|---|---|
committer | Tim Hatch <tim@timhatch.com> | 2010-12-21 22:34:20 -0800 |
commit | b86e4172cae193be7822b844533d39a4ee4e4968 (patch) | |
tree | 1fcb58bb4686e3f7fa1e371ef6cd8017596bb9be | |
parent | 92e3cf387d93ea5e1d2e0313d3250a4a993a5b5e (diff) | |
download | pygments-b86e4172cae193be7822b844533d39a4ee4e4968.tar.gz |
Allow rfc822-style continuation in ini files (#494)
-rw-r--r-- | pygments/lexers/text.py | 2 | ||||
-rw-r--r-- | tests/examplefiles/test.ini | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py index 074794c8..5a63e503 100644 --- a/pygments/lexers/text.py +++ b/pygments/lexers/text.py @@ -42,7 +42,7 @@ class IniLexer(RegexLexer): (r'\s+', Text), (r'[;#].*?$', Comment), (r'\[.*?\]$', Keyword), - (r'(.*?)([ \t]*)(=)([ \t]*)(.*?)$', + (r'(.*?)([ \t]*)(=)([ \t]*)(.*(?:\n[ \t].+)*)', bygroups(Name.Attribute, Text, Operator, Text, String)) ] } diff --git a/tests/examplefiles/test.ini b/tests/examplefiles/test.ini new file mode 100644 index 00000000..a447803d --- /dev/null +++ b/tests/examplefiles/test.ini @@ -0,0 +1,10 @@ +[section] + +foo = bar +continued = foo + baz +conttwo = + foo +; comment +# comment + |