-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmapping-old.php
236 lines (203 loc) · 7.99 KB
/
mapping-old.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
<?php
/*
<p style='ps-0' dir='ltr'>
<c style='cs-0' lang='tl-0'>Test</c>
</p>
<p style='ps-0' dir='ltr'>
<c style='cs-0' lang='tl-0' over='co-0'>Fett</c><c style='cs-0' lang='tl-0' over='co-1'/>
<c style='cs-0' lang='tl-0' over='co-2'>Kursiv</c><c style='cs-0' lang='tl-0' over='co-1'/>
<c style='cs-0' lang='tl-0' over='co-3'>Unterstrichen</c><c style='cs-0' lang='tl-0' over='co-4'> Freitext</c>
</p>
<p style='ps-0' dir='ltr'>
<c style='cs-0' lang='tl-0' over='co-4'>Test String am Ende.</c>
<c style='cs-0'>
<selection-insertion-point/>
<page-break/>
</c>
</p>
<p style='ps-1' dir='ltr'>
<c style='cs-0'/>
</p>
</section>
*/
$m = array(
// p = function name (either "p" or "p_open" and p_close)
// replacement = The pattern to replace bzw. to split the template
// template = template with replacement
// alias = other common names for the tag
// subpattern = when there are additional parts in the template which have to be replaced (ex. h1 and footnotes)
//<c style="cs-0">
'p' => array(
'replacement' => 'normaler Text',
'alias' => array('section'),
'subpattern' => array(),
// Normaler Text mit Absatz!
'template' => "<p style='ps-0' dir='ltr'>normaler Text</p>",
// 'template' => "<c style='cs-0'>normaler Text</c>",
),
// normaler Text
'cdata' => array(
'replacement' => 'CDATA',
'alias' => array(),
'subpattern' => array(),
'template' => "<c style='cs-0'>CDATA</c>",
),
'header' => array(
'replacement' => 'UEBERSCHRIFT',
'alias' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6'),
'subpattern' => array('{{LEVEL}}'),
'template' => "<p style='ps-1' dir='ltr'>
<c style='cs-2'><autotitle level='{{LEVEL}}' index='0' model-string-length='{{LENGTH}}'><c style='cs-2' lang='tl-0'>UEBERSCHRIFT</c></autotitle></c>
</p>",
),
'footnote' => array(
'replacement' => 'Fussnote',
'alias' => array(),
'subpattern' => array('{{NOTE}}'),
// Template contains another template of "normaler Text"!
// 'template' => "<p style='ps-0' dir='ltr'>
// <c style='cs-3'>{{NOTE}}<note stream='nsm-0'>
// <p style='ps-0' dir='ltr'>
// <c style='cs-0' lang='tl-0'>Fussnote</c>
// </p>
// </note>
// </c>
// </p>",
'template' => "<c style='cs-3'>{{NOTE}}<note stream='nsm-0'>
<p style='ps-0' dir='ltr'>
<c style='cs-0' lang='tl-0'>Fussnote</c>
</p>
</note>
</c>",
),
'externallink' => array(
'replacement' => 'EXTERNALLINK',
'alias' => array('internallink', 'internalmedia'), // TODO internalmedia might not work
'subpattern' => array('{{TITLE}}'),
'template' => "<c style='cs-0'><hyperlink display-as-link='yes'><display-text><c style='cs-0'>{{TITLE}}</c><c style='cs-0'/></display-text><url-string>EXTERNALLINK</url-string></hyperlink></c>",
),
// http://mountaindragon.com/html/iso.htm
'doublequoteopening' => array(
'replacement' => 'DOUBLEQUOTEOPENING',
'alias' => array(),
'subpattern' => array(),
#'template' => '&qout;',
'template' => '<c style="cs-0">"</c>',
),
'doublequoteclosing' => array(
'replacement' => 'DOUBLEQUOTECLOSING',
'alias' => array(),
'subpattern' => array(),
#'template' => '&qout;',
'template' => '<c style="cs-0">"</c>',
),
'singlequoteopening' => array(
'replacement' => 'SINGLEQUOTEOPENING',
'alias' => array(),
'subpattern' => array(),
'template' => '<c style="cs-0">\'</c>',
),
'singlequoteclosing' => array(
'replacement' => 'SINGLEQUOTECLOSING',
'alias' => array(),
'subpattern' => array(),
'template' => '<c style="cs-0">\'</c>',
),
'plain' => array(
'replacement' => 'PLAIN',
'alias' => array('entity', 'acronym', 'preformatted'),
'subpattern' => array(),
'template' => "<c style='cs-0'>PLAIN</c>", // same template as "p", correct?
),
// <list style="ls-0">
// <p style="ps-0" dir="ltr" list-level="1">
// <c style="cs-0">Erstens </c>
// </p>
// <p style="ps-0" dir="ltr" list-level="1">
// <c style="cs-0">Zweitens <selection-insertion-point/></c>
// </p>
// <p style="ps-0" dir="ltr" list-level="1">
// <c style="cs-0">Drittens</c>
// </p>
// </list>
'list' => array(
'replacement' => 'LIST',
'alias' => array('listu', 'listo'),
'subpattern' => array(),
'template' => '<list style="ls-0">LIST</list>',
'template_p_open' => '</p><list style="ls-0">LIST</list><p style="ps-0" dir="ltr">',
),
'listcontent' => array(
'replacement' => 'LISTCONTENT',
'alias' => array(),
'subpattern' => array(),
'template' => 'LISTCONTENT',
),
'listitem' => array(
'replacement' => 'LISTITEM',
'alias' => array(),
'subpattern' => array('{{LEVEL}}'),
'template' => '<p style="ps-0" dir="ltr" list-level="{{LEVEL}}">LISTITEM</p>',
),
'strong' => array(
'replacement' => 'BOLD',
'alias' => array(),
'subpattern' => array(),
'template' => "<c style='cs-0' lang='tl-0' over='co-0'>BOLD</c>",
),
'emphasis' => array(
'replacement' => 'EMPHASIS',
'alias' => array('italic'),
'subpattern' => array(),
'template' => "<c style='cs-0' lang='tl-0' over='co-2'>EMPHASIS</c>",
),
'underline' => array(
'replacement' => 'UNDERLINE',
'alias' => array(),
'subpattern' => array(),
'template' => "<c style='cs-0' over='co-3'>UNDERLINE</c>",
),
'deleted' => array(
'replacement' => 'DELETED',
'alias' => array(),
'subpattern' => array(),
'template' => '<c style="cs-0" over="co-4">DELETED</c>',
),
'monospace' => array(
'replacement' => 'MONOSPACE',
'alias' => array(),
'subpattern' => array(),
'template' => '<c style="cs-0" over="co-5">MONOSPACE</c>',
),
'code' => array(
'replacement' => 'CODE',
'alias' => array(),
'subpattern' => array(),
'template' => '<p style="ps-0" dir="ltr"><c style="cs-0" lang="tl-0" over="co-5">CODE</c></p>',
),
'smiley' => array(
'replacement' => 'SMILEY',
'alias' => array(),
'subpattern' => array(),
'template' => 'SMILEY',
),
'table' => array(
'replacement' => 'TABLE',
'alias' => array(),
'subpattern' => array(),
'template' => 'TABLE',
),
'tablerow' => array(
'replacement' => 'TABLEROW',
'alias' => array(),
'subpattern' => array(),
'template' => "<p style='ps-0' dir='ltr'>TABLEROW</p>",
),
'tablecell' => array(
'replacement' => 'TABLECELL',
'alias' => array(),
'subpattern' => array(),
'template' => '<c style="cs-0"> | </c>TABLECELL<c style="cs-0"> | </c>',
// 'template' => 'TABLECELL ',
),
);