ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
email.php
Go to the documentation of this file.
1<?php
2/*************************************************************************************
3 * email.php
4 * ---------------
5 * Author: Benny Baumann (BenBE@geshi.org)
6 * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
7 * Release Version: 1.0.8.12
8 * Date Started: 2008/10/19
9 *
10 * Email (mbox \ eml \ RFC format) language file for GeSHi.
11 *
12 * CHANGES
13 * -------
14 * 2008/10/19 (1.0.8.1)
15 * - First Release
16 *
17 * TODO (updated 2008/10/19)
18 * -------------------------
19 * * Better checks when a header field should be expected
20 * * Fix the bound checks for kw groups 2 and 3, as well as rx group 1
21 *
22 *************************************************************************************
23 *
24 * This file is part of GeSHi.
25 *
26 * GeSHi is free software; you can redistribute it and/or modify
27 * it under the terms of the GNU General Public License as published by
28 * the Free Software Foundation; either version 2 of the License, or
29 * (at your option) any later version.
30 *
31 * GeSHi is distributed in the hope that it will be useful,
32 * but WITHOUT ANY WARRANTY; without even the implied warranty of
33 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 * GNU General Public License for more details.
35 *
36 * You should have received a copy of the GNU General Public License
37 * along with GeSHi; if not, write to the Free Software
38 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 *
40 ************************************************************************************/
41
43 'LANG_NAME' => 'eMail (mbox)',
44 'COMMENT_SINGLE' => array(),
45 'COMMENT_MULTI' => array(),
46 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
47 'QUOTEMARKS' => array('"'),
48 'ESCAPE_CHAR' => '',
49 'KEYWORDS' => array(
50 1 => array(
51 'HTTP', 'SMTP', 'ASMTP', 'ESMTP'
52 ),
53 2 => array(
54 'Authentication-Results','Comment','Content-Description','Content-Type',
55 'Content-Disposition','Content-Transfer-Encoding','Delivered-To',
56 'Dkim-Signature','Domainkey-Signature','In-Reply-To','Message-Id',
57 'MIME-Version','OpenPGP','Received','Received-SPF','References',
58 'Reply-To', 'Resend-From','Resend-To','Return-Path','User-Agent'
59 ),
60 3 => array(
61 'Date','From','Sender','Subject','To','CC'
62 ),
63 4 => array(
64 'by', 'for', 'from', 'id', 'with'
65 )
66 ),
67 'SYMBOLS' => array(
68 ':', ';', '<', '>', '[', ']'
69 ),
70 'CASE_SENSITIVE' => array(
71 GESHI_COMMENTS => false,
72 1 => true,
73 2 => false,
74 3 => false,
75 4 => true
76 ),
77 'STYLES' => array(
78 'KEYWORDS' => array(
79 1 => 'color: #0000FF; font-weight: bold;',
80 2 => 'color: #000000; font-weight: bold;',
81 3 => 'color: #800000; font-weight: bold;',
82 4 => 'font-weight: bold;',
83 ),
84 'COMMENTS' => array(
85 ),
86 'ESCAPE_CHAR' => array(
87 0 => 'color: #000099; font-weight: bold;'
88 ),
89 'BRACKETS' => array(
90 0 => 'color: #66cc66;'
91 ),
92 'STRINGS' => array(
93 0 => 'color: #ff0000;'
94 ),
95 'NUMBERS' => array(
96 0 => 'color: #cc66cc;'
97 ),
98 'METHODS' => array(
99 ),
100 'SYMBOLS' => array(
101 0 => 'color: #66cc66;'
102 ),
103 'SCRIPT' => array(
104 0 => 'color: #000040;',
105 ),
106 'REGEXPS' => array(
107 1 => 'color: #000000; font-weight: bold;',
108 2 => 'color: #0000FF;',
109 3 => 'color: #008000;',
110 4 => 'color: #0000FF; font-weight: bold;',
111 5 => 'font-weight: bold;',
112 6 => 'color: #400080;'
113 )
114 ),
115 'URLS' => array(
116 1 => '',
117 2 => '',
118 3 => '',
119 4 => ''
120 ),
121 'OOLANG' => false,
122 'OBJECT_SPLITTERS' => array(
123 ),
124 'REGEXPS' => array(
125 // Non-Standard-Header
126 1 => array(
127 GESHI_SEARCH => "(?<=\A\x20|\n)x-[a-z0-9\-]*(?=\s*:|\s*<)",
128 GESHI_REPLACE => "\\0",
129 GESHI_MODIFIERS => "smi",
130 GESHI_BEFORE => "",
131 GESHI_AFTER => ""
132 ),
133 //Email-Adresses or Mail-IDs
134 2 => array(
135 GESHI_SEARCH => "\b(?<!\\/)(?P<q>\"?)[\w\.\-]+\k<q>@(?!-)[\w\-]+(?<!-)(?:(?:\.(?!-)[\w\-]+(?<!-))*)?",
136 GESHI_REPLACE => "\\0",
137 GESHI_MODIFIERS => "mi",
138 GESHI_BEFORE => "",
139 GESHI_AFTER => ""
140 ),
141 //Date values in RFC format
142 3 => array(
143 GESHI_SEARCH => "\b(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s+\d\d?\s+" .
144 "(?:Jan|Feb|Mar|apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+" .
145 "\d{4}\s+\d\d?:\d\d:\d\d\s+[+\-]\d{4}(?:\s+\‍(\w+\‍))?",
146 GESHI_REPLACE => "\\0",
147 GESHI_MODIFIERS => "mi",
148 GESHI_BEFORE => "",
149 GESHI_AFTER => ""
150 ),
151 //IP addresses
152 4 => array(
153 GESHI_SEARCH => "(?<=\s)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=\s)|".
154 "(?<=\[)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=\])|".
155 "(?<==)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=<)|".
156
157 "(?<=\s)(?:[a-f\d]{1,4}\:)+(?:[a-f\d]{0,4})?(?:\:[a-f\d]{1,4})+(?=\s)|".
158 "(?<=\[)(?:[a-f\d]{1,4}\:)+(?:[a-f\d]{0,4})?(?:\:[a-f\d]{1,4})+(?=\])|".
159 "(?<==)(?:[a-f\d]{1,4}\:)+(?:[a-f\d]{0,4})?(?:\:[a-f\d]{1,4})+(?=<)|".
160
161 "(?<=\s)\:(?:\:[a-f\d]{1,4})+(?=\s)|".
162 "(?<=\[)\:(?:\:[a-f\d]{1,4})+(?=\])|".
163 "(?<==)\:(?:\:[a-f\d]{1,4})+(?=<)|".
164
165 "(?<=\s)(?:[a-f\d]{1,4}\:)+\:(?=\s)|".
166 "(?<=\[)(?:[a-f\d]{1,4}\:)+\:(?=\])|".
167 "(?<==)(?:[a-f\d]{1,4}\:)+\:(?=<)",
168 GESHI_REPLACE => "\\0",
169 GESHI_MODIFIERS => "i",
170 GESHI_BEFORE => "",
171 GESHI_AFTER => ""
172 ),
173 //Field-Assignments
174 5 => array(
175 GESHI_SEARCH => "(?<=\s)[A-Z0-9\-\.]+(?==(?:$|\s$|[^\s=]))",
176 GESHI_REPLACE => "\\0",
177 GESHI_MODIFIERS => "mi",
178 GESHI_BEFORE => "",
179 GESHI_AFTER => ""
180 ),
181 //MIME type
182 6 => array(
183 GESHI_SEARCH => "(?<=\s)(?:audio|application|image|multipart|text|".
184 "video|x-[a-z0-9\-]+)\/[a-z0-9][a-z0-9\-]*(?=\s|<|$)",
185 GESHI_REPLACE => "\\0",
186 GESHI_MODIFIERS => "m",
187 GESHI_BEFORE => "",
188 GESHI_AFTER => ""
189 )
190 ),
191 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
192 'SCRIPT_DELIMITERS' => array(
193 0 => "/(?P<start>^)[A-Za-z][a-zA-Z0-9\-]*\s*:\s*(?:.|(?=\n\s)\n)*(?P<end>$)/m"
194 ),
195 'HIGHLIGHT_STRICT_BLOCK' => array(
196 0 => true,
197 ),
198 'TAB_WIDTH' => 4,
199 'PARSER_CONTROL' => array(
200 'KEYWORDS' => array(
201 2 => array(
202 'DISALLOWED_BEFORE' => '(?<=\A\x20|\n)',
203 'DISALLOWED_AFTER' => '(?=\s*:)',
204 ),
205 3 => array(
206 'DISALLOWED_BEFORE' => '(?<=\A\x20|\n)',
207 'DISALLOWED_AFTER' => '(?=\s*:)',
208 ),
209 4 => array(
210 'DISALLOWED_BEFORE' => '(?<=\s)',
211 'DISALLOWED_AFTER' => '(?=\s|\b)',
212 )
213 ),
214 'ENABLE_FLAGS' => array(
215 'BRACKETS' => GESHI_NEVER,
216 'COMMENTS' => GESHI_NEVER,
217 'NUMBERS' => GESHI_NEVER
218 )
219 )
220);
An exception for terminatinating execution or to throw for unit testing.
$language_data
Definition: email.php:42
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.
Definition: geshi.php:95
const GESHI_BEFORE
The key of the regex array defining what bracket group in a matched search to put before the replacem...
Definition: geshi.php:141
const GESHI_SEARCH
The key of the regex array defining what to search for.
Definition: geshi.php:133
const GESHI_AFTER
The key of the regex array defining what bracket group in a matched search to put after the replaceme...
Definition: geshi.php:144
const GESHI_ALWAYS
Strict mode always applies.
Definition: geshi.php:129
const GESHI_REPLACE
The key of the regex array defining what bracket group in a matched search to use as a replacement.
Definition: geshi.php:136
const GESHI_COMMENTS
Used in language files to mark comments.
Definition: geshi.php:150
const GESHI_NEVER
#+ @access private
Definition: geshi.php:124
const GESHI_MODIFIERS
The key of the regex array defining any modifiers to the regular expression.
Definition: geshi.php:138