[SPIP] ~maj v3.0.14-->v3.0.17
[ptitvelo/web/www.git] / www / plugins-dist / textwheel / wheels / spip / spip.yaml
1 --- # Syntaxe des raccourcis SPIP, version 0.0.1
2 #
3 # Si on nomme une regle, elle devient surchargeable
4
5 traiter_retours_chariots_1:
6 # Harmonise les retours chariots et mange les paragraphes html
7 if_chars: "\r"
8 match: ",\r\n?,S"
9 replace: "\n"
10 priority: -40 # avant tout
11
12 traiter_retours_chariots_2:
13 if_str: "<p"
14 match: ",<p[>[:space:]],iS"
15 replace: "\n\n$0"
16 priority: -40 # avant tout
17
18 traiter_retours_chariots_3:
19 if_str: "</p"
20 match: ",</p[>[:space:]],iS"
21 replace: "$0\n\n"
22 priority: -40 # avant tout
23
24 init-trim:
25 # trim
26 type: all
27 is_callback: y
28 replace: trim
29 priority: -40 # avant tout
30
31 init-saut:
32 type: all
33 replace: "\n$0"
34 priority: -40
35
36 lignes-vides:
37 match: ",^[ \t]+$,m"
38 replace: ""
39 priority: -35 # avant les tableaux
40
41 tableaux:
42 type: all
43 # included subwheel with relative filepath
44 replace: spip/spip-tableaux.yaml
45 is_wheel: Y
46 if_str: "\n|"
47 priority: -30 # avant les raccourcis
48
49 listes:
50 if_str: "\n-"
51 is_wheel: Y
52 type: all
53 replace: spip/spip-listes.yaml
54 priority: -20 # avant !paragraphes
55
56 echappe-tags:
57 # voir restaure-tags plus bas
58 match: ",</?[a-z!][^<>]*?[{}_-][^<>]*>,imsS"
59 if_chars: "{}_-"
60 priority: -20 # avant !paragraphes
61 is_wheel: Y
62 replace:
63 echappe-tags-sub:
64 if_match: "/[{}]|\n[_-]|--/"
65 match: ['{', '}', '_', '-']
66 replace: ["\x1\x1", "\x1\x2", "\x1\x3", "\x1\x4"]
67 type: str
68
69 ligne-horizontale:
70 match: "/\n(----+|____+)/S"
71 replace: "\n\n\n<hr class=\"spip\" />\n\n\n"
72 if_chars: "\n"
73 priority: -20 # avant !paragraphes
74
75 alinea:
76 match: "/\n-- */"
77 replace: "\n<br />&mdash;&nbsp;"
78 if_str: "\n--"
79 priority: -20 # avant !paragraphes
80
81 puce:
82 match: "/\n- */S"
83 replace: replace_puce
84 if_str: "\n-"
85 is_callback: Y
86 priority: -20 # avant !paragraphes
87
88 br-inutile:
89 match: "/(^|^\n|\n\n)_ +/S"
90 replace: "$1"
91 if_str: "_ "
92 priority: -20 # avant !paragraphes
93
94 br:
95 match: "/\n_ +/S"
96 replace: "<br class='manualbr' />"
97 if_str: "\n_"
98 priority: -20 # avant !paragraphes
99
100 abbr:
101 # raccourcis en [ABBR|abbreviation]
102 if_chars: "["
103 if_chars: "|"
104 match: "/\[([^\|\[\]>]+)\|([^\|\]\{>]+)(?:\{([a-z]+)\})?\]/S"
105 is_callback: Y
106 replace: inserer_abbr
107
108 intertitres-compliques:
109 # raccourcis imbriques en {{{{..}}}}
110 # intertitres
111 match: ['/(^|[^{])[{][{][{]/S', '/[}][}][}]($|[^}])/S']
112 replace: ["$1\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n$1"]
113 if_str: '}}}}'
114
115 intertitres:
116 # raccourcis en {{{..}}}
117 # intertitres
118 match: ['{{{', '}}}']
119 replace: ["\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n"]
120 if_str: '{{{'
121 type: str
122
123 gras:
124 # raccourcis en {{..}}
125 # strong
126 match: ['{{', '}}']
127 replace: ['<strong>', '</strong>']
128 type: str
129 if_str: '{{'
130
131 italiques:
132 # raccourcis en {..}
133 # strong
134 match: ['{', '}']
135 replace: ['<i>', '</i>']
136 type: str
137 if_str: '{'
138
139 paragraphes:
140 # paragraphes
141 # lignes vides consecutives, br imbriques dans des p
142 # mais attention pas les br trop riches (ex: br style=clear:both)
143 match: ["/ *\n(?: *\n)+(?:<br ?\/?>)*/S", '/(?:<br\b[^>]*>){2,}\s*/S', "/(<p\b[^>]*>)\n*(?:<br ?\/?>\n*)+/S"]
144 replace: ['<p>', '<p>', '$1']
145 priority: 0
146
147 quote:
148 # raccourci <quote>
149 match: ['<quote>', '</quote>']
150 replace: ['<blockquote class="spip"><p>', '</blockquote><p>']
151 if_str: '<quote>'
152 type: str
153
154 intro:
155 # suppr raccourci <intro>
156 # + suppression de <intro>
157 match: ['<intro>', '</intro>']
158 replace: ['', '']
159 if_str: '<intro>'
160 type: str
161
162 br-restant:
163 # eliminer les br restant en debut de texte
164 match: "@^\n<br />@S"
165 replace: ''
166 if_str: "\n<br"
167 priority: -20 # avant !paragraphes
168
169
170 poesie:
171 # poesie|poetry
172 # utilise une callback
173 match: ",<poe(sie|try)>(.*)</poe(sie|try)>,UimsS"
174 replace: spip/spip-poesie.yaml
175 pick_match: 2
176 is_wheel: Y
177 if_str: '<poe'
178 priority: -40
179
180 restaure-tags:
181 # voir echappe-tags ci-dessus
182 if_chars: "\x1"
183 match: ["\x1\x1", "\x1\x2", "\x1\x3", "\x1\x4"]
184 replace: ['{', '}', '_', '-']
185 type: str
186
187 echappe-chevron-solitaire:
188 # un < qui n'est pas suivi d'une lettre ou d'un / est toujours echappe
189 type: preg
190 match: "/<(?=[^a-z\/!])/Uims"
191 replace: "&lt;"
192
193 echappe-chevron-pas-ferme:
194 # un < suivi d'une lettre ou d'un / est echappe si il semble mal ferme
195 type: preg
196 match: "/<([^><\"'!]*)(?=<|$)/Uims"
197 replace: "&lt;$1"