[BUGFIX] Treat <pre> tags correctly in RTE
[Packages/TYPO3.CMS.git] / typo3 / sysext / fluid_styled_content / Configuration / TypoScript / Static / Setup / lib.parseFunc.ts
1 # Creates persistent ParseFunc setup for non-HTML content.
2 lib.parseFunc {
3         makelinks = 1
4         makelinks {
5                 http {
6                         keep = {$styles.content.links.keep}
7                         extTarget = {$styles.content.links.extTarget}
8                 }
9                 mailto {
10                         keep = path
11                 }
12         }
13         tags {
14                 link = TEXT
15                 link {
16                         current = 1
17                         typolink {
18                                 parameter.data = parameters : allParams
19                                 extTarget = {$styles.content.links.extTarget}
20                                 target = {$styles.content.links.target}
21                         }
22                         parseFunc.constants = 1
23                 }
24         }
25         allowTags = {$styles.content.allowTags}
26         denyTags = *
27         sword = <span class="ce-sword">|</span>
28         constants = 1
29         nonTypoTagStdWrap {
30                 HTMLparser = 1
31                 HTMLparser {
32                         keepNonMatchedTags = 1
33                         htmlSpecialChars = 2
34                 }
35         }
36 }
37
38
39 # Creates persistent ParseFunc setup for RTE content (which is mainly HTML) based on the "ts_css" transformation.
40 lib.parseFunc_RTE < lib.parseFunc
41 lib.parseFunc_RTE {
42         # Processing <table> and <blockquote> blocks separately
43         externalBlocks = article, aside, blockquote, div, dd, dl, footer, header, nav, ol, section, table, ul, pre
44         externalBlocks {
45                 # The blockquote content is passed into parseFunc again...
46                 blockquote {
47                         stripNL = 1
48                         callRecursive = 1
49                         callRecursive {
50                                 tagStdWrap {
51                                         HTMLparser = 1
52                                         HTMLparser.tags.blockquote.overrideAttribs = style="margin-bottom:0;margin-top:0;"
53                                 }
54                         }
55                 }
56
57                 ol {
58                         stripNL = 1
59                         stdWrap.parseFunc = < lib.parseFunc
60                 }
61
62                 ul {
63                         stripNL = 1
64                         stdWrap.parseFunc = < lib.parseFunc
65                 }
66
67                 table {
68                         stripNL = 1
69                         stdWrap {
70                                 HTMLparser = 1
71                                 HTMLparser {
72                                         tags.table.fixAttrib.class {
73                                                 default = contenttable
74                                                 always = 1
75                                                 list = contenttable
76                                         }
77                                         keepNonMatchedTags = 1
78                                 }
79                         }
80                         HTMLtableCells = 1
81                         HTMLtableCells {
82                                 # Recursive call to self but without wrapping non-wrapped cell content
83                                 default.stdWrap {
84                                         parseFunc = < lib.parseFunc_RTE
85                                         parseFunc.nonTypoTagStdWrap.encapsLines.nonWrappedTag =
86                                 }
87                                 addChr10BetweenParagraphs = 1
88                         }
89                 }
90
91                 div {
92                         stripNL = 1
93                         callRecursive = 1
94                 }
95
96                 article < .div
97                 aside < .div
98                 footer < .div
99                 header < .div
100                 nav < .div
101                 section < .div
102                 dl < .div
103                 dd < .div
104         }
105         nonTypoTagStdWrap {
106                 encapsLines {
107                         encapsTagList = p,pre,h1,h2,h3,h4,h5,h6,hr,dt
108                         remapTag.DIV = P
109                         nonWrappedTag = P
110                         innerStdWrap_all.ifBlank = &nbsp;
111                 }
112         }
113         nonTypoTagStdWrap {
114                 HTMLparser = 1
115                 HTMLparser {
116                         keepNonMatchedTags = 1
117                         htmlSpecialChars = 2
118                 }
119         }
120 }