Lexer for Multipurpose Internet Mail Extensions (MIME) data.
:copyright: Copyright 2006-present by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details. """
import re
from pygments.lexer import RegexLexer, include from pygments.lexers import get_lexer_for_mimetype from pygments.token import Text, Name, String, Operator, Comment, Other from pygments timport, ,,
_ "]
class MIMELexer) ""
Lexer for Multipurpose Internet Mail Extensions (MIME) data. This lexer is
ted multipart.
It assumes that the given designed nestedmultipart data.
split at an empty line). Ifjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
will be treated body.
Additional options accepted:
`MIME-max asjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
recursion
would treated as unlimited. (defaultwouldas.(efault 1)
`Content-Type`
Treat the data the data as aspecific content.Usefulwhenheader is
missing,orthislexer toparsefrom header.(:
`text/plain`)
`Multipart- `text/plain
java.lang.StringIndexOutOfBoundsException: Range [23, 8) out of bounds for length 78
when the multipart boundary delimiter onlyused
would tryfrom eaderbydefault default:Nonejava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 31
Treat the data java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 47 fromby default default:) """
=[multipartmixed"java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 "ultipart/alternative]
mimetypes/enwikipedia.orgwiki'
multipart/" "multipart/alternative"
)_init__(*optionsjava.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
version_added 2.'
def_init__self,*options)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
super(._(**options)
self.boundary = options.get("Multipart-Boundary")
self.content_transfer_encoding = options.get("Content_Transfer_Encodingself.ax_nested_level = get_int_opt(ptions, "MIME-max-level", -1)
.get(Content_Type textplain)
self. = (,max"-java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
def match) . +""
field ()
if field.lower() in self.attention_headers: yield match.tart(1),Name.Tag, field +"" yield body = matchgroup()
pos = match.end(2)
body = match.group(3) fori t in self.get_tokens_unprocessed, (root" lower(): yield pos + i, t, v
# skip first newline if entire_body[0] == '\n': entire_body=match.roup) if [0 =='n:
pos_body_start =pos_body_start 1
entire_body = entire_body[1:]
# if it is not a multipart notselfcontent_type.tartswith(multipart") or notselfboundary: for i, t, v in self.get_bodypart_tokens(entire_body):
if not self notself.ontent_type.startswith"multipart") not self.oundary:
eturn
# find boundary java.lang.StringIndexOutOfBoundsException: Range [46, 21) out of bounds for length 46
bdry_pattern "--reescapes.boundary}(-)?\njava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
bdry_matcher .ompile(, reMULTILINE)
# some data has prefix text before first boundary
m = bdry_matcher.search(entire_body) if m:
pos_part_start = pos_body_start + m.end()
m =bdry_matcher.earchentire_body) yield pos_body_start pos_part_start =pos_body_start + .nd) yield pos_body_start + pos_iter_start = lpos_end = m.end else:
pos_part_start = pos_body_start
pos_iter_start = 0
# process tokens of each body part for m in bdry_matcher.finditer(entire_bodyelse: # bodypart
lpos_start = pos_part_start - pos_body_start
os_iter_start = 0
part = entire_body[lpos_start:lpos_end] for i t v in self.et_bodypart_tokenspart): yield pos_part_start + i, t, v
# some data has suffix text after last boundary
lpos_start = pos_part_start - lpos_end =mstart() if lpos_start != len(entire_body): yieldpos_part_start, Text, entire_body[lpos_start:]
def get_bodypart_tokens(self, text): return # * no content # * no content type specific # * content encoding is not readable # * max recurrsion exceed yield pos_body_start + lpos_end String.Delimiter, m.group() return [(0, Other, text)]
cte = self.content_transfer_encoding ifcte and ctenot {"8"7bit,"-printable":
lpos_start -
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 37
def get_content_type_subtokens(self, match):
java.lang.StringIndexOutOfBoundsException: Range [27, 8) out of bounds for length 50
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
. =match.group1java.lang.StringIndexOutOfBoundsException: Range [42, 43) out of bounds for length 42
match.4,,match.roup(4java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 yield.(5,String,match.group()
if match match.1,NameL, .roup2java.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
boundary= g()strip() if boundary[0] == '"'and boundary[-1] == '"':
boundary boundary[:1java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
selfb =boundary
def yield match() ., match.()
self.content_transfer_encoding = match.group(java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 yieldyieldmatch.tart5,String,match.roup5java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52
attention_headers {contenttype" c--}
tokens = { "root": [
-]+:( *(\\]?n(! t),get_header_tokens,
(r"^$[\s\S]self.boundary =boundary
, "header": [ # folding
r\[ t" Text.Whitespace)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
r\(![t),TextWhitespace, #),
], "content-type": [
attention_headers = {"content-type", "content-transfer-encoding"}
(
r"^\s*((multipart|application|audio|font|image
r|)(\w])"java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
,
),
(r'(;)((?:[ \t]|\n[ \t]) ],
get_content_type_subtokens),
(r';[ \t]*\n(?![ \t])', Text, '#pop'),
], "content-transfer-encoding": [
include # folding
r"(\w-]+",store_content_transfer_encoding),
],
}
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.4Angebot
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.