-
Notifications
You must be signed in to change notification settings - Fork 781
Closed
Labels
A-lexingarea: changes to individual lexersarea: changes to individual lexersT-bugtype: a bugtype: a bug
Milestone
Description
Hi,
When using HTTP Lexer with content type "application/x-www-form-urlencoded", the POST body data does not get highlighted. For example, assume this HTTP request.
Test code:
from pygments import highlight
from pygments.formatters import Terminal256Formatter
from pygments.lexers import HttpLexer
code='''
POST /demo/submit/ HTTP/1.1
Host: pygments.org
Connection: keep-alivk
Cache-Control: max-age=0
Origin: http://pygments.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2)
AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7
Content-Type: application/x-www-form-urlencoded
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://pygments.org/
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: windows-949,utf-8;q=0.7,*;q=0.3
name=test&lang=text&code=asdf&user=
'''
print(highlight(code, HttpLexer(), Terminal256Formatter()))The headers get highlighted, however all the POST body has the same colour.
Any ideas how to get the body highlighted too?
Thank you.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-lexingarea: changes to individual lexersarea: changes to individual lexersT-bugtype: a bugtype: a bug