fuel 0.3.26 → 0.3.27

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2c1112035abc422c172871bc422f4454cd7dc439
4
- data.tar.gz: b08740f6937d95bc7c64848550b8d594e929abd1
3
+ metadata.gz: 716908b6931831ce1c0b87d0f101c9751ddcec49
4
+ data.tar.gz: 6aae71a34dda5e288f75f00fe147b1f2dbd8d0ed
5
5
  SHA512:
6
- metadata.gz: c3585a9522fd8051fe052f6d8994922e8cc7620985bb1bf4b748fd0b223fcebfbfe943a917c47ebf9448d6e93acd5e7f086db2b4b21ee23c785e45b8340127d6
7
- data.tar.gz: 4c240eaaa33e7524d34029c21c02123a9546e841d80b026fb8439e4e18a10ef82f5e21ba58ea341b71db5e7d9d08ede17dd44492229819bd9f342243e483a776
6
+ metadata.gz: 5328b457d779933c1d6f3768212b8d17756016587ceddaee44312bd2525f581aa0c7e5c51ebb109867a87c1b41fdd8a7a474e7eb5b85066c22f40bdc4d3c99c5
7
+ data.tar.gz: 4d3e59acfc149e5115705b5ac73e822810ae848926601213ed9bdf463f462238695b354c720d5c18486ca2f72e466b14a75fb83aaf333690b4e5de8563ae0b19
@@ -0,0 +1,683 @@
1
+ /**
2
+ * Full HTML5 compatibility rule set
3
+ * Loosened and extended ruleset. Allows more freedom on user side
4
+ * These rules define which tags and CSS classes are supported and which tags should be specially treated.
5
+ */
6
+
7
+ var wysihtml5ParserRulesDefaults = {
8
+ "blockLevelEl": {
9
+ "keep_styles": {
10
+ "textAlign": /^((left)|(right)|(center)|(justify))$/i,
11
+ "float": 1
12
+ },
13
+ "add_style": {
14
+ "align": "align_text"
15
+ },
16
+ "check_attributes": {
17
+ "id": "any"
18
+ }
19
+ },
20
+
21
+ "makeDiv": {
22
+ "rename_tag": "div",
23
+ "one_of_type": {
24
+ "alignment_object": 1
25
+ },
26
+ "remove_action": "unwrap",
27
+ "keep_styles": {
28
+ "textAlign": 1,
29
+ "float": 1
30
+ },
31
+ "add_style": {
32
+ "align": "align_text"
33
+ },
34
+ "check_attributes": {
35
+ "id": "any"
36
+ }
37
+ }
38
+ };
39
+
40
+ var wysihtml5ParserRules = {
41
+ /**
42
+ * CSS Class white-list
43
+ * Following CSS classes won't be removed when parsed by the wysihtml5 HTML parser
44
+ * If all classes should pass "any" as classes value. Ex: "classes": "any"
45
+ */
46
+ "classes": "any",
47
+
48
+ /* blacklist of classes is only available if classes is set to any */
49
+ "classes_blacklist": {
50
+ "Apple-interchange-newline": 1,
51
+ "MsoNormal": 1,
52
+ "MsoPlainText": 1
53
+ },
54
+
55
+ "type_definitions": {
56
+
57
+ "alignment_object": {
58
+ "classes": {
59
+ "wysiwyg-text-align-center": 1,
60
+ "wysiwyg-text-align-justify": 1,
61
+ "wysiwyg-text-align-left": 1,
62
+ "wysiwyg-text-align-right": 1,
63
+ "wysiwyg-float-left": 1,
64
+ "wysiwyg-float-right": 1
65
+ },
66
+ "styles": {
67
+ "float": ["left", "right"],
68
+ "text-align": ["left", "right", "center"]
69
+ }
70
+ },
71
+
72
+ "valid_image_src": {
73
+ "attrs": {
74
+ "src": /^[^data\:]/i
75
+ }
76
+ },
77
+
78
+ "text_color_object": {
79
+ "styles": {
80
+ "color": true,
81
+ "background-color": true
82
+ }
83
+ },
84
+
85
+ "text_fontsize_object": {
86
+ "styles": {
87
+ "font-size": true
88
+ }
89
+ },
90
+
91
+ "text_formatting_object": {
92
+ "classes": {
93
+ "wysiwyg-color-aqua": 1,
94
+ "wysiwyg-color-black": 1,
95
+ "wysiwyg-color-blue": 1,
96
+ "wysiwyg-color-fuchsia": 1,
97
+ "wysiwyg-color-gray": 1,
98
+ "wysiwyg-color-green": 1,
99
+ "wysiwyg-color-lime": 1,
100
+ "wysiwyg-color-maroon": 1,
101
+ "wysiwyg-color-navy": 1,
102
+ "wysiwyg-color-olive": 1,
103
+ "wysiwyg-color-purple": 1,
104
+ "wysiwyg-color-red": 1,
105
+ "wysiwyg-color-silver": 1,
106
+ "wysiwyg-color-teal": 1,
107
+ "wysiwyg-color-white": 1,
108
+ "wysiwyg-color-yellow": 1,
109
+ "wysiwyg-font-size-large": 1,
110
+ "wysiwyg-font-size-larger": 1,
111
+ "wysiwyg-font-size-medium": 1,
112
+ "wysiwyg-font-size-small": 1,
113
+ "wysiwyg-font-size-smaller": 1,
114
+ "wysiwyg-font-size-x-large": 1,
115
+ "wysiwyg-font-size-x-small": 1,
116
+ "wysiwyg-font-size-xx-large": 1,
117
+ "wysiwyg-font-size-xx-small": 1
118
+ }
119
+ }
120
+ },
121
+
122
+ "comments": 1, // if set allows comments to pass
123
+
124
+ /**
125
+ * Tag list
126
+ *
127
+ * The following options are available:
128
+ *
129
+ * - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
130
+ * The following methods are implemented in wysihtml5.dom.parse:
131
+ * - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
132
+ * <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
133
+ * - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
134
+ * <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
135
+ * - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
136
+ *
137
+ * - remove: removes the element and its content
138
+ *
139
+ * - unwrap removes element but leaves content
140
+ *
141
+ * - rename_tag: renames the element to the given tag
142
+ *
143
+ * - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
144
+ *
145
+ * - set_attributes: sets/overrides the given attributes
146
+ *
147
+ * - check_attributes: checks the given HTML attribute via the given method
148
+ * - url: allows only valid urls (starting with http:// or https://)
149
+ * - src: allows something like "/foobar.jpg", "http://google.com", ...
150
+ * - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg"
151
+ * - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
152
+ * - numbers: ensures that the attribute only contains numeric characters
153
+ * - any: allows anything to pass
154
+ */
155
+ "tags": {
156
+ "tr": {
157
+ "add_style": {
158
+ "align": "align_text"
159
+ },
160
+ "check_attributes": {
161
+ "id": "any"
162
+ }
163
+ },
164
+ "strike": {
165
+ "unwrap": 1
166
+ },
167
+ "form": {
168
+ "unwrap": 1
169
+ },
170
+ "rt": {
171
+ "rename_tag": "span"
172
+ },
173
+ "code": {},
174
+ "acronym": {
175
+ "rename_tag": "span"
176
+ },
177
+ "br": {
178
+ "add_class": {
179
+ "clear": "clear_br"
180
+ }
181
+ },
182
+ "details": {
183
+ "unwrap": 1
184
+ },
185
+ "h4": wysihtml5ParserRulesDefaults.blockLevelEl,
186
+ "em": {},
187
+ "title": {
188
+ "remove": 1
189
+ },
190
+ "multicol": {
191
+ "unwrap": 1
192
+ },
193
+ "figure": {
194
+ "unwrap": 1
195
+ },
196
+ "xmp": {
197
+ "unwrap": 1
198
+ },
199
+ "small": {
200
+ "rename_tag": "span",
201
+ "set_class": "wysiwyg-font-size-smaller"
202
+ },
203
+ "area": {
204
+ "remove": 1
205
+ },
206
+ "time": {
207
+ "unwrap": 1
208
+ },
209
+ "dir": {
210
+ "rename_tag": "ul"
211
+ },
212
+ "bdi": {
213
+ "unwrap": 1
214
+ },
215
+ "command": {
216
+ "unwrap": 1
217
+ },
218
+ "ul": {
219
+ "check_attributes": {
220
+ "id": "any"
221
+ }
222
+ },
223
+ "progress": {
224
+ "rename_tag": "span"
225
+ },
226
+ "dfn": {
227
+ "unwrap": 1
228
+ },
229
+ "iframe": {
230
+ "check_attributes": {
231
+ "src": "any",
232
+ "width": "any",
233
+ "height": "any",
234
+ "frameborder": "any",
235
+ "style": "any",
236
+ "id": "any"
237
+ }
238
+ },
239
+ "figcaption": {
240
+ "unwrap": 1
241
+ },
242
+ "a": {
243
+ "check_attributes": {
244
+ "href": "href", // if you compiled master manually then change this from 'url' to 'href'
245
+ "rel": "any",
246
+ "target": "any",
247
+ "id": "any"
248
+ }
249
+ },
250
+ "img": {
251
+ "one_of_type": {
252
+ "valid_image_src": 1
253
+ },
254
+ "check_attributes": {
255
+ "width": "numbers",
256
+ "alt": "alt",
257
+ "src": "src", // if you compiled master manually then change this from 'url' to 'src'
258
+ "height": "numbers",
259
+ "id": "any"
260
+ },
261
+ "add_class": {
262
+ "align": "align_img"
263
+ }
264
+ },
265
+ "rb": {
266
+ "unwrap": 1
267
+ },
268
+ "footer": wysihtml5ParserRulesDefaults.makeDiv,
269
+ "noframes": {
270
+ "remove": 1
271
+ },
272
+ "abbr": {
273
+ "unwrap": 1
274
+ },
275
+ "u": {},
276
+ "bgsound": {
277
+ "remove": 1
278
+ },
279
+ "sup": {
280
+ "unwrap": 1
281
+ },
282
+ "address": {
283
+ "unwrap": 1
284
+ },
285
+ "basefont": {
286
+ "remove": 1
287
+ },
288
+ "nav": {
289
+ "unwrap": 1
290
+ },
291
+ "h1": wysihtml5ParserRulesDefaults.blockLevelEl,
292
+ "head": {
293
+ "unwrap": 1
294
+ },
295
+ "tbody": wysihtml5ParserRulesDefaults.blockLevelEl,
296
+ "dd": {
297
+ "unwrap": 1
298
+ },
299
+ "s": {
300
+ "unwrap": 1
301
+ },
302
+ "li": {},
303
+ "td": {
304
+ "check_attributes": {
305
+ "rowspan": "numbers",
306
+ "colspan": "numbers",
307
+ "valign": "any",
308
+ "align": "any",
309
+ "id": "any",
310
+ "class": "any"
311
+ },
312
+ "keep_styles": {
313
+ "backgroundColor": 1,
314
+ "width": 1,
315
+ "height": 1
316
+ },
317
+ "add_style": {
318
+ "align": "align_text"
319
+ }
320
+ },
321
+ "object": {
322
+ "remove": 1
323
+ },
324
+
325
+ "div": {
326
+ "one_of_type": {
327
+ "alignment_object": 1
328
+ },
329
+ "remove_action": "unwrap",
330
+ "keep_styles": {
331
+ "textAlign": 1,
332
+ "float": 1
333
+ },
334
+ "add_style": {
335
+ "align": "align_text"
336
+ },
337
+ "check_attributes": {
338
+ "id": "any",
339
+ "contenteditable": "any"
340
+ }
341
+ },
342
+
343
+ "option": {
344
+ "remove":1
345
+ },
346
+ "select": {
347
+ "remove":1
348
+ },
349
+ "i": {},
350
+ "track": {
351
+ "remove": 1
352
+ },
353
+ "wbr": {
354
+ "remove": 1
355
+ },
356
+ "fieldset": {
357
+ "unwrap": 1
358
+ },
359
+ "big": {
360
+ "rename_tag": "span",
361
+ "set_class": "wysiwyg-font-size-larger"
362
+ },
363
+ "button": {
364
+ "unwrap": 1
365
+ },
366
+ "noscript": {
367
+ "remove": 1
368
+ },
369
+ "svg": {
370
+ "remove": 1
371
+ },
372
+ "input": {
373
+ "remove": 1
374
+ },
375
+ "table": {
376
+ "keep_styles": {
377
+ "width": 1,
378
+ "textAlign": 1,
379
+ "float": 1
380
+ },
381
+ "check_attributes": {
382
+ "id": "any"
383
+ }
384
+ },
385
+ "keygen": {
386
+ "remove": 1
387
+ },
388
+ "h5": wysihtml5ParserRulesDefaults.blockLevelEl,
389
+ "meta": {
390
+ "remove": 1
391
+ },
392
+ "map": {
393
+ "remove": 1
394
+ },
395
+ "isindex": {
396
+ "remove": 1
397
+ },
398
+ "mark": {
399
+ "unwrap": 1
400
+ },
401
+ "caption": wysihtml5ParserRulesDefaults.blockLevelEl,
402
+ "tfoot": wysihtml5ParserRulesDefaults.blockLevelEl,
403
+ "base": {
404
+ "remove": 1
405
+ },
406
+ "video": {
407
+ "remove": 1
408
+ },
409
+ "strong": {},
410
+ "canvas": {
411
+ "remove": 1
412
+ },
413
+ "output": {
414
+ "unwrap": 1
415
+ },
416
+ "marquee": {
417
+ "unwrap": 1
418
+ },
419
+ "b": {},
420
+ "q": {
421
+ "check_attributes": {
422
+ "cite": "url",
423
+ "id": "any"
424
+ }
425
+ },
426
+ "applet": {
427
+ "remove": 1
428
+ },
429
+ "span": {
430
+ "one_of_type": {
431
+ "text_formatting_object": 1,
432
+ "text_color_object": 1,
433
+ "text_fontsize_object": 1
434
+ },
435
+ "keep_styles": {
436
+ "color": 1,
437
+ "backgroundColor": 1,
438
+ "fontSize": 1
439
+ },
440
+ "remove_action": "unwrap",
441
+ "check_attributes": {
442
+ "id": "any"
443
+ }
444
+ },
445
+ "rp": {
446
+ "unwrap": 1
447
+ },
448
+ "spacer": {
449
+ "remove": 1
450
+ },
451
+ "source": {
452
+ "remove": 1
453
+ },
454
+ "aside": wysihtml5ParserRulesDefaults.makeDiv,
455
+ "frame": {
456
+ "remove": 1
457
+ },
458
+ "section": wysihtml5ParserRulesDefaults.makeDiv,
459
+ "body": {
460
+ "unwrap": 1
461
+ },
462
+ "ol": {},
463
+ "nobr": {
464
+ "unwrap": 1
465
+ },
466
+ "html": {
467
+ "unwrap": 1
468
+ },
469
+ "summary": {
470
+ "unwrap": 1
471
+ },
472
+ "var": {
473
+ "unwrap": 1
474
+ },
475
+ "del": {
476
+ "unwrap": 1
477
+ },
478
+ "blockquote": {
479
+ "keep_styles": {
480
+ "textAlign": 1,
481
+ "float": 1
482
+ },
483
+ "add_style": {
484
+ "align": "align_text"
485
+ },
486
+ "check_attributes": {
487
+ "cite": "url",
488
+ "id": "any"
489
+ }
490
+ },
491
+ "style": {
492
+ "check_attributes": {
493
+ "type": "any",
494
+ "src": "any",
495
+ "charset": "any"
496
+ }
497
+ },
498
+ "device": {
499
+ "remove": 1
500
+ },
501
+ "meter": {
502
+ "unwrap": 1
503
+ },
504
+ "h3": wysihtml5ParserRulesDefaults.blockLevelEl,
505
+ "textarea": {
506
+ "unwrap": 1
507
+ },
508
+ "embed": {
509
+ "remove": 1
510
+ },
511
+ "hgroup": {
512
+ "unwrap": 1
513
+ },
514
+ "font": {
515
+ "rename_tag": "span",
516
+ "add_class": {
517
+ "size": "size_font"
518
+ }
519
+ },
520
+ "tt": {
521
+ "unwrap": 1
522
+ },
523
+ "noembed": {
524
+ "remove": 1
525
+ },
526
+ "thead": {
527
+ "add_style": {
528
+ "align": "align_text"
529
+ },
530
+ "check_attributes": {
531
+ "id": "any"
532
+ }
533
+ },
534
+ "blink": {
535
+ "unwrap": 1
536
+ },
537
+ "plaintext": {
538
+ "unwrap": 1
539
+ },
540
+ "xml": {
541
+ "remove": 1
542
+ },
543
+ "h6": wysihtml5ParserRulesDefaults.blockLevelEl,
544
+ "param": {
545
+ "remove": 1
546
+ },
547
+ "th": {
548
+ "check_attributes": {
549
+ "rowspan": "numbers",
550
+ "colspan": "numbers",
551
+ "valign": "any",
552
+ "align": "any",
553
+ "id": "any"
554
+ },
555
+ "keep_styles": {
556
+ "backgroundColor": 1,
557
+ "width": 1,
558
+ "height": 1
559
+ },
560
+ "add_style": {
561
+ "align": "align_text"
562
+ }
563
+ },
564
+ "legend": {
565
+ "unwrap": 1
566
+ },
567
+ "hr": {},
568
+ "label": {
569
+ "unwrap": 1
570
+ },
571
+ "dl": {
572
+ "unwrap": 1
573
+ },
574
+ "kbd": {
575
+ "unwrap": 1
576
+ },
577
+ "listing": {
578
+ "unwrap": 1
579
+ },
580
+ "dt": {
581
+ "unwrap": 1
582
+ },
583
+ "nextid": {
584
+ "remove": 1
585
+ },
586
+ "pre": {},
587
+ "center": wysihtml5ParserRulesDefaults.makeDiv,
588
+ "audio": {
589
+ "remove": 1
590
+ },
591
+ "datalist": {
592
+ "unwrap": 1
593
+ },
594
+ "samp": {
595
+ "unwrap": 1
596
+ },
597
+ "col": {
598
+ "remove": 1
599
+ },
600
+ "article": wysihtml5ParserRulesDefaults.makeDiv,
601
+ "cite": {},
602
+ "link": {
603
+ "remove": 1
604
+ },
605
+ "script": {
606
+ "check_attributes": {
607
+ "type": "any",
608
+ "src": "any",
609
+ "charset": "any"
610
+ }
611
+ },
612
+ "bdo": {
613
+ "unwrap": 1
614
+ },
615
+ "menu": {
616
+ "rename_tag": "ul"
617
+ },
618
+ "colgroup": {
619
+ "remove": 1
620
+ },
621
+ "ruby": {
622
+ "unwrap": 1
623
+ },
624
+ "h2": wysihtml5ParserRulesDefaults.blockLevelEl,
625
+ "ins": {
626
+ "unwrap": 1
627
+ },
628
+ "p": wysihtml5ParserRulesDefaults.blockLevelEl,
629
+ "sub": {
630
+ "unwrap": 1
631
+ },
632
+ "comment": {
633
+ "remove": 1
634
+ },
635
+ "frameset": {
636
+ "remove": 1
637
+ },
638
+ "optgroup": {
639
+ "unwrap": 1
640
+ },
641
+ "header": wysihtml5ParserRulesDefaults.makeDiv
642
+ }
643
+ };
644
+
645
+
646
+ (function() {
647
+ // Paste cleanup rules universal for all rules (also applied to content copied from editor)
648
+ var commonRules = wysihtml5.lang.object(wysihtml5ParserRules).clone(true);
649
+ commonRules.comments = false;
650
+ commonRules.selectors = { "a u": "unwrap"};
651
+ commonRules.tags.style = { "remove": 1 };
652
+ commonRules.tags.script = { "remove": 1 };
653
+ commonRules.tags.head = { "remove": 1 };
654
+
655
+ // Paste cleanup for unindentified source
656
+ var universalRules = wysihtml5.lang.object(commonRules).clone(true);
657
+ universalRules.tags.div.one_of_type.alignment_object = 1;
658
+ universalRules.tags.div.remove_action = "unwrap";
659
+ universalRules.tags.div.check_attributes.style = false;
660
+ universalRules.tags.div.keep_styles = {
661
+ "textAlign": /^((left)|(right)|(center)|(justify))$/i,
662
+ "float": 1
663
+ };
664
+ universalRules.tags.span.keep_styles = false;
665
+
666
+ // Paste cleanup for MS Office
667
+ // TODO: should be extended to stricter ruleset, as current set will probably not cover all Office bizarreness
668
+ var msOfficeRules = wysihtml5.lang.object(universalRules).clone(true);
669
+ msOfficeRules.classes = {};
670
+
671
+ window.wysihtml5ParserPasteRulesets = [
672
+ {
673
+ condition: /<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument|class="OutlineElement|id="?docs\-internal\-guid\-/i,
674
+ set: msOfficeRules
675
+ },{
676
+ condition: /<meta name="copied-from" content="wysihtml5">/i,
677
+ set: commonRules
678
+ },{
679
+ set: universalRules
680
+ }
681
+ ];
682
+
683
+ })();