diff options
author | gbrandl <devnull@localhost> | 2008-09-23 23:05:53 +0200 |
---|---|---|
committer | gbrandl <devnull@localhost> | 2008-09-23 23:05:53 +0200 |
commit | 420f7fa8594b96d6eed23073f0525a431218bb3e (patch) | |
tree | c66bec1f66113e036c3cf37d2f9130170112c3dd | |
parent | d97401fd65164c0d472966d8c20f29d27c4a6055 (diff) | |
parent | 179c00fef6ca282a523242a666889d94579cd436 (diff) | |
download | pygments-420f7fa8594b96d6eed23073f0525a431218bb3e.tar.gz |
Merge with ben-testing.
-rw-r--r-- | CHANGES | 8 | ||||
-rw-r--r-- | pygments/lexer.py | 7 | ||||
-rw-r--r-- | pygments/lexers/_mapping.py | 4 | ||||
-rw-r--r-- | pygments/lexers/math.py | 1 | ||||
-rw-r--r-- | pygments/lexers/text.py | 2 |
5 files changed, 15 insertions, 7 deletions
@@ -5,6 +5,10 @@ Version 0.12 ------------ (codename not selected, release XXX XX, 2008) +- Don't use join(splitlines()) when converting newlines to ``\n``, + because that doesn't keep all newlines at the end when the + ``stripnl`` lexer option is False. + - Add Tango style, written by Andre Roberge for the Crunchy project. - Add Python3TracebackLexer and ``python3`` option to @@ -21,6 +25,10 @@ Version 0.12 - Actually use the `font_size` option of the image formatter. +- Fixed numpy lexer that it doesn't listen for "*.py" any longer. + +- Unified Diff lexer supports the "udiff" alias now. + Version 0.11.1 -------------- diff --git a/pygments/lexer.py b/pygments/lexer.py index 5c41d4a2..cba93e4f 100644 --- a/pygments/lexer.py +++ b/pygments/lexer.py @@ -127,10 +127,9 @@ class Lexer(object): Also preprocess the text, i.e. expand tabs and strip it if wanted and applies registered filters. """ - if isinstance(text, unicode): - text = u'\n'.join(text.splitlines()) - else: - text = '\n'.join(text.splitlines()) + text = text.replace('\r\n', '\n') + text = text.replace('\r', '\n') + if not isinstance(text, unicode): if self.encoding == 'guess': try: text = text.decode('utf-8') diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index 8337eda6..ba255dae 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -46,7 +46,7 @@ LEXERS = { 'DarcsPatchLexer': ('pygments.lexers.text', 'Darcs Patch', ('dpatch',), ('*.dpatch', '*.darcspatch'), ()), 'DebianControlLexer': ('pygments.lexers.text', 'Debian Control file', ('control',), ('control',), ()), 'DelphiLexer': ('pygments.lexers.compiled', 'Delphi', ('delphi', 'pas', 'pascal', 'objectpascal'), ('*.pas',), ('text/x-pascal',)), - 'DiffLexer': ('pygments.lexers.text', 'Diff', ('diff',), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')), + 'DiffLexer': ('pygments.lexers.text', 'Diff', ('diff', 'udiff'), ('*.diff', '*.patch'), ('text/x-diff', 'text/x-patch')), 'DjangoLexer': ('pygments.lexers.templates', 'Django/Jinja', ('django', 'jinja'), (), ('application/x-django-templating', 'application/x-jinja')), 'DylanLexer': ('pygments.lexers.compiled', 'Dylan', ('dylan',), ('*.dylan',), ('text/x-dylan',)), 'ErbLexer': ('pygments.lexers.templates', 'ERB', ('erb',), (), ('application/x-ruby-templating',)), @@ -100,7 +100,7 @@ LEXERS = { 'MyghtyXmlLexer': ('pygments.lexers.templates', 'XML+Myghty', ('xml+myghty',), (), ('application/xml+myghty',)), 'NasmLexer': ('pygments.lexers.asm', 'NASM', ('nasm',), ('*.asm', '*.ASM'), ('text/x-nasm',)), 'NginxConfLexer': ('pygments.lexers.text', 'Nginx configuration file', ('nginx',), (), ('text/x-nginx-conf',)), - 'NumPyLexer': ('pygments.lexers.math', 'NumPy', ('numpy',), ('*.py', '*.pyw', '*.sc', 'SConstruct', 'SConscript'), ()), + 'NumPyLexer': ('pygments.lexers.math', 'NumPy', ('numpy',), (), ()), 'ObjdumpLexer': ('pygments.lexers.asm', 'objdump', ('objdump',), ('*.objdump',), ('text/x-objdump',)), 'ObjectiveCLexer': ('pygments.lexers.compiled', 'Objective-C', ('objective-c', 'objectivec', 'obj-c', 'objc'), ('*.m',), ('text/x-objective-c',)), 'OcamlLexer': ('pygments.lexers.compiled', 'OCaml', ('ocaml',), ('*.ml', '*.mli', '*.mll', '*.mly'), ('text/x-ocaml',)), diff --git a/pygments/lexers/math.py b/pygments/lexers/math.py index 3ba89a7c..aa3b2ad8 100644 --- a/pygments/lexers/math.py +++ b/pygments/lexers/math.py @@ -255,6 +255,7 @@ class NumPyLexer(PythonLexer): # override the mimetypes to not inherit them from python mimetypes = [] + filenames = [] EXTRA_KEYWORDS = set([ 'abs', 'absolute', 'accumulate', 'add', 'alen', 'all', 'allclose', diff --git a/pygments/lexers/text.py b/pygments/lexers/text.py index 5b0688e7..b3c11c1f 100644 --- a/pygments/lexers/text.py +++ b/pygments/lexers/text.py @@ -208,7 +208,7 @@ class DiffLexer(RegexLexer): """ name = 'Diff' - aliases = ['diff'] + aliases = ['diff', 'udiff'] filenames = ['*.diff', '*.patch'] mimetypes = ['text/x-diff', 'text/x-patch'] |