fhdp-extenders 4.10.6-SNAPSHOT-1696607426403 → 4.10.7-PL-SNAPSHOT-1749639573917
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Module.ts +84 -84
- package/README.md +97 -97
- package/cached-package.json +1 -1
- package/dist/source/extenders/FHMLExtender.js +19 -0
- package/dist/source/extenders/FHMLExtender.js.map +1 -1
- package/package.json +5 -5
- package/postpublish.js +15 -15
- package/prepublish.js +15 -15
- package/source/RelocatorRules.ts +216 -216
- package/source/extenders/CookieParser.ts +8 -8
- package/source/extenders/CookiePoliticsHandler.ts +101 -101
- package/source/extenders/DynamicRelocator.ts +71 -71
- package/source/extenders/FHMLExtender.ts +330 -311
- package/source/extenders/PortalProcessHandler.ts +177 -177
- package/tsconfig.json +18 -18
|
@@ -1,312 +1,331 @@
|
|
|
1
|
-
import {FhContainer, FHML,} from "fh-forms-handler";
|
|
2
|
-
import {EVENTS_LIST} from "../constants";
|
|
3
|
-
import {Portal} from './PortalProcessHandler';
|
|
4
|
-
|
|
5
|
-
type TagMetaType = {
|
|
6
|
-
tag: string,
|
|
7
|
-
tagConstructor: (...args:any[]) => string,
|
|
8
|
-
attr?: any,
|
|
9
|
-
noContent?: boolean
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const meta: TagMetaType[] = [
|
|
13
|
-
{
|
|
14
|
-
tag: 'br/',
|
|
15
|
-
tagConstructor: (match, contents) => {
|
|
16
|
-
var br = document.createElement('br');
|
|
17
|
-
return br.outerHTML;
|
|
18
|
-
},
|
|
19
|
-
noContent: true
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
tag: '
|
|
23
|
-
tagConstructor: (match,
|
|
24
|
-
var
|
|
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
|
-
blockquote.
|
|
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
|
-
return
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
if (meta.
|
|
185
|
-
portal.setAttribute('
|
|
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
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
1
|
+
import {FhContainer, FHML,} from "fh-forms-handler";
|
|
2
|
+
import {EVENTS_LIST} from "../constants";
|
|
3
|
+
import {Portal} from './PortalProcessHandler';
|
|
4
|
+
|
|
5
|
+
type TagMetaType = {
|
|
6
|
+
tag: string,
|
|
7
|
+
tagConstructor: (...args:any[]) => string,
|
|
8
|
+
attr?: any,
|
|
9
|
+
noContent?: boolean
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const meta: TagMetaType[] = [
|
|
13
|
+
{
|
|
14
|
+
tag: 'br/',
|
|
15
|
+
tagConstructor: (match, contents) => {
|
|
16
|
+
var br = document.createElement('br');
|
|
17
|
+
return br.outerHTML;
|
|
18
|
+
},
|
|
19
|
+
noContent: true
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
tag: 'hr/',
|
|
23
|
+
tagConstructor: (match, contents) => {
|
|
24
|
+
var hr = document.createElement('hr');
|
|
25
|
+
return hr.outerHTML;
|
|
26
|
+
},
|
|
27
|
+
noContent: true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
tag: 'className',
|
|
31
|
+
tagConstructor: (match, classes, contents) => {
|
|
32
|
+
var span = document.createElement('span');
|
|
33
|
+
span.classList.add('fhml');
|
|
34
|
+
classes.split(',').forEach((cssClass) => {
|
|
35
|
+
span.classList.add(cssClass);
|
|
36
|
+
});
|
|
37
|
+
span.innerHTML = contents;
|
|
38
|
+
return span.outerHTML;
|
|
39
|
+
},
|
|
40
|
+
attr: '([a-zA-Z0-9\-\, ]+)'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
tag: 'del',
|
|
44
|
+
tagConstructor: (match, contents) => {
|
|
45
|
+
var del = document.createElement('del');
|
|
46
|
+
del.innerHTML = contents;
|
|
47
|
+
return del.outerHTML;
|
|
48
|
+
},
|
|
49
|
+
noContent: false
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
tag: 's',
|
|
53
|
+
tagConstructor: (match, contents) => {
|
|
54
|
+
var del = document.createElement('del');
|
|
55
|
+
del.innerHTML = contents;
|
|
56
|
+
return del.outerHTML;
|
|
57
|
+
},
|
|
58
|
+
noContent: false
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
tag: 'mark',
|
|
62
|
+
tagConstructor: (match, contents) => {
|
|
63
|
+
var mark = document.createElement('mark');
|
|
64
|
+
mark.innerHTML = contents;
|
|
65
|
+
return mark.outerHTML;
|
|
66
|
+
},
|
|
67
|
+
noContent: false
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
tag: 'blockquote',
|
|
71
|
+
tagConstructor: (match, contents) => {
|
|
72
|
+
var blockquote = document.createElement('blockquote');
|
|
73
|
+
blockquote.classList.add('blockquote')
|
|
74
|
+
blockquote.innerHTML = contents;
|
|
75
|
+
return blockquote.outerHTML;
|
|
76
|
+
},
|
|
77
|
+
noContent: false
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
tag: 'q',
|
|
81
|
+
tagConstructor: (match, contents) => {
|
|
82
|
+
var blockquote = document.createElement('blockquote');
|
|
83
|
+
blockquote.classList.add('blockquote')
|
|
84
|
+
blockquote.innerHTML = contents;
|
|
85
|
+
return blockquote.outerHTML;
|
|
86
|
+
},
|
|
87
|
+
noContent: false
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
tag: 'bqFooter',
|
|
91
|
+
tagConstructor: (match, contents) => {
|
|
92
|
+
var blockquote = document.createElement('footer');
|
|
93
|
+
blockquote.classList.add('blockquote-footer')
|
|
94
|
+
blockquote.innerHTML = contents;
|
|
95
|
+
return blockquote.outerHTML;
|
|
96
|
+
},
|
|
97
|
+
noContent: false
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
tag: 'ul',
|
|
101
|
+
tagConstructor: (match, contents) => {
|
|
102
|
+
var ul = document.createElement('ul');
|
|
103
|
+
ul.innerHTML = contents;
|
|
104
|
+
return ul.outerHTML;
|
|
105
|
+
},
|
|
106
|
+
noContent: false
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
tag: 'li',
|
|
110
|
+
tagConstructor: (match, contents) => {
|
|
111
|
+
var li = document.createElement('li');
|
|
112
|
+
li.innerHTML = contents;
|
|
113
|
+
return li.outerHTML;
|
|
114
|
+
},
|
|
115
|
+
noContent: false
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
tag: 'code',
|
|
119
|
+
tagConstructor: (match, contents) => {
|
|
120
|
+
const fhml = FhContainer.get<FHML>('FHML');
|
|
121
|
+
var span = document.createElement('span');
|
|
122
|
+
span.classList.add('highlight');
|
|
123
|
+
span.style.background = '#dcdce5';
|
|
124
|
+
span.style.padding = '5px';
|
|
125
|
+
span.style.display = 'inline-block'
|
|
126
|
+
span.innerHTML = '<pre><code>' + contents + '</code></pre>';
|
|
127
|
+
return span.outerHTML;
|
|
128
|
+
},
|
|
129
|
+
noContent: false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
tag: 'portal',
|
|
133
|
+
tagConstructor: (match, attr) => {
|
|
134
|
+
console.warn('THIS PORTAL TAG IS DEPRECATED. PLEASE USE fhportal!');
|
|
135
|
+
const attrList = attr.split(',');
|
|
136
|
+
const idPart = attrList[0];
|
|
137
|
+
const portalId = document.querySelectorAll(`[id^='${idPart}']`)[0].id;
|
|
138
|
+
const portalElement = document.getElementById(portalId);
|
|
139
|
+
const parentPortalElement = (portalElement.parentNode as HTMLElement);
|
|
140
|
+
parentPortalElement.style.display = "none";
|
|
141
|
+
const newElement = (portalElement.cloneNode(true) as HTMLElement);
|
|
142
|
+
newElement.id = `${portalElement.id}_portal`;
|
|
143
|
+
|
|
144
|
+
EVENTS_LIST.forEach(el => {
|
|
145
|
+
newElement.setAttribute(`on${el}`, `document.getElementById("${portalElement.id}").${el}();`);
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
if(attrList.length > 1) {
|
|
149
|
+
const stylesList: string[] = attrList[1].split(' ');
|
|
150
|
+
stylesList.forEach(styleName => {
|
|
151
|
+
newElement.classList.add(styleName);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return newElement.outerHTML;
|
|
156
|
+
},
|
|
157
|
+
attr: '([a-zA-Z0-9\-\, ]+)',
|
|
158
|
+
noContent: true
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
tag: 'fhportal',
|
|
162
|
+
tagConstructor: (match, attr) => {
|
|
163
|
+
new Portal();
|
|
164
|
+
try {
|
|
165
|
+
const parseAttr = (attr: string): {v?:string, layer?: string, wrapped?: string, id? : string, classes? : string, replaceParentId?: string, removeWrapper?: string, searchParent?: string, searchClosestLike?: string} => {
|
|
166
|
+
console.log(attr);
|
|
167
|
+
const res = {};
|
|
168
|
+
const variables = attr.split(';');
|
|
169
|
+
for (const variable of variables) {
|
|
170
|
+
let [key, value] = variable.split('=')
|
|
171
|
+
if (value[0] === '[' && value[value.length - 1] === ']') {
|
|
172
|
+
value = value.substr(1);
|
|
173
|
+
value = value.substr(0, value.length - 1);
|
|
174
|
+
}
|
|
175
|
+
if (['id', 'classes', 'wrapped', 'layer', 'v', 'searchClosestLike', 'searchParent', 'replaceParentId', 'removeWrapper'].indexOf(key) > -1) {
|
|
176
|
+
res[key] = value
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return res;
|
|
180
|
+
}
|
|
181
|
+
const meta = parseAttr(attr)
|
|
182
|
+
const portal = document.createElement('fh-portal')
|
|
183
|
+
portal.setAttribute('used', 'false');
|
|
184
|
+
if (meta.id) {
|
|
185
|
+
portal.setAttribute('objId', meta.id);
|
|
186
|
+
} else {
|
|
187
|
+
return '<div>NO fhportal ID!</div>'
|
|
188
|
+
}
|
|
189
|
+
if (meta.searchClosestLike) {
|
|
190
|
+
portal.setAttribute('searchClosestLike', meta.searchClosestLike);
|
|
191
|
+
}
|
|
192
|
+
if (meta.searchParent) {
|
|
193
|
+
portal.setAttribute('searchParent', meta.searchParent);
|
|
194
|
+
}
|
|
195
|
+
if (meta.classes) {
|
|
196
|
+
portal.setAttribute('classes', meta.classes);
|
|
197
|
+
}
|
|
198
|
+
if (meta.wrapped) {
|
|
199
|
+
portal.setAttribute('wrapped', meta.wrapped);
|
|
200
|
+
}
|
|
201
|
+
if (meta.layer) {
|
|
202
|
+
portal.setAttribute('layer', meta.layer);
|
|
203
|
+
}
|
|
204
|
+
if (meta.v) {
|
|
205
|
+
portal.setAttribute('v', meta.v);
|
|
206
|
+
}
|
|
207
|
+
if(meta.replaceParentId) {
|
|
208
|
+
portal.setAttribute('replaceParentId', meta.replaceParentId)
|
|
209
|
+
}
|
|
210
|
+
if(meta.removeWrapper) {
|
|
211
|
+
portal.setAttribute('removeWrapper', meta.removeWrapper)
|
|
212
|
+
}
|
|
213
|
+
return portal.outerHTML;
|
|
214
|
+
} catch (e) {
|
|
215
|
+
console.error(e.message);
|
|
216
|
+
return '<div>Error portal</div>'
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
attr: '(.+)',
|
|
220
|
+
noContent: true
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
tag: 'nbsp',
|
|
224
|
+
tagConstructor: (match, attr) => {
|
|
225
|
+
const repTime = Number(attr);
|
|
226
|
+
if (!isNaN(repTime)) {
|
|
227
|
+
var span = document.createElement('span');
|
|
228
|
+
span.style.paddingLeft = `${repTime}em`;
|
|
229
|
+
return span.outerHTML;
|
|
230
|
+
}
|
|
231
|
+
return '';
|
|
232
|
+
},
|
|
233
|
+
attr: '([a-zA-Z0-9\-\, ]+)',
|
|
234
|
+
noContent: true
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
tag: 'unescape',
|
|
238
|
+
tagConstructor: (match, attr) => {
|
|
239
|
+
const code = String(attr);
|
|
240
|
+
const span = document.createElement('span');
|
|
241
|
+
span.innerHTML += `&#${code};`;
|
|
242
|
+
return span.outerHTML;
|
|
243
|
+
},
|
|
244
|
+
attr: '([a-zA-Z0-9\-\, ]+)',
|
|
245
|
+
noContent: true
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
tag: 'ahref',
|
|
249
|
+
tagConstructor: (match, attr, contents) => {
|
|
250
|
+
try {
|
|
251
|
+
const parseAttr = (attr: string): {href?:string, alt?: string, target?: string} => {
|
|
252
|
+
const res = {};
|
|
253
|
+
const variables = attr.split(';');
|
|
254
|
+
for (const variable of variables) {
|
|
255
|
+
let [key, value] = variable.split('=')
|
|
256
|
+
if (value[0] === '[' && value[value.length - 1] === ']') {
|
|
257
|
+
value = value.substr(1);
|
|
258
|
+
value = value.substr(0, value.length - 1);
|
|
259
|
+
}
|
|
260
|
+
if (['href', 'alt', 'target'].indexOf(key) > -1) {
|
|
261
|
+
res[key] = value
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return res;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const meta = parseAttr(attr)
|
|
268
|
+
const aElement = document.createElement('a');
|
|
269
|
+
|
|
270
|
+
if (meta.href) {
|
|
271
|
+
aElement.href = meta.href;
|
|
272
|
+
}
|
|
273
|
+
if (meta.alt) {
|
|
274
|
+
aElement.setAttribute('alt', meta.alt);
|
|
275
|
+
}
|
|
276
|
+
if (meta.target) {
|
|
277
|
+
aElement.setAttribute('target', meta.target);
|
|
278
|
+
}
|
|
279
|
+
if (!!contents) {
|
|
280
|
+
aElement.innerHTML = contents;
|
|
281
|
+
}
|
|
282
|
+
return aElement.outerHTML;
|
|
283
|
+
} catch (e) {
|
|
284
|
+
console.error(e.message);
|
|
285
|
+
return ''
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
attr: '(.+)',
|
|
289
|
+
noContent: false
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
tag: 'rawTag',
|
|
293
|
+
tagConstructor: (match, attr) => {
|
|
294
|
+
if(!attr) {
|
|
295
|
+
return '';
|
|
296
|
+
}
|
|
297
|
+
return `<${attr}>`;
|
|
298
|
+
},
|
|
299
|
+
attr: '([a-zA-Z0-9\-\, \/]+)',
|
|
300
|
+
noContent: true
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
tag: 'extAttributes/',
|
|
304
|
+
tagConstructor: (match, contents) => {
|
|
305
|
+
return '';
|
|
306
|
+
},
|
|
307
|
+
noContent: true
|
|
308
|
+
},
|
|
309
|
+
]
|
|
310
|
+
|
|
311
|
+
function registerTags(tagsMeta: TagMetaType[]) {
|
|
312
|
+
const fhml = FhContainer.get<FHML>('FHML');
|
|
313
|
+
const oldParse = fhml.needParse.bind(fhml);
|
|
314
|
+
fhml.needParse = function(str) {
|
|
315
|
+
var regexString = '\\[(';
|
|
316
|
+
regexString += meta.map(function (tag) {
|
|
317
|
+
return tag.tag;
|
|
318
|
+
}).join('|');
|
|
319
|
+
regexString += ')[=a-zA-Z0-9 #,\.\(\)\'\-\_.*]*\\]';
|
|
320
|
+
var res = (str || '').match(new RegExp(regexString));
|
|
321
|
+
|
|
322
|
+
return (res && typeof res === 'object') ? !!res.length : oldParse(str);
|
|
323
|
+
};
|
|
324
|
+
for (const tagMeta of tagsMeta) {
|
|
325
|
+
fhml.registerTag(tagMeta.tag, tagMeta.tagConstructor, tagMeta.attr, tagMeta.noContent);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export const extendFHML = (): void => {
|
|
330
|
+
registerTags(meta)
|
|
312
331
|
}
|