1 --- # Syntaxe des raccourcis SPIP, version 0.0.1
3 # Si on nomme une regle, elle devient surchargeable
5 traiter_retours_chariots_1:
6 # Harmonise les retours chariots et mange les paragraphes html
10 priority: -40 # avant tout
12 traiter_retours_chariots_2:
14 match: ",<p[>[:space:]],iS"
16 priority: -40 # avant tout
18 traiter_retours_chariots_3:
20 match: ",</p[>[:space:]],iS"
22 priority: -40 # avant tout
29 priority: -40 # avant tout
39 priority: -35 # avant les tableaux
43 # included subwheel with relative filepath
44 replace: spip/spip-tableaux.yaml
47 priority: -30 # avant les raccourcis
53 replace: spip/spip-listes.yaml
54 priority: -20 # avant !paragraphes
57 # voir restaure-tags plus bas
58 match: ",</?[a-z!][^<>]*?[{}_-][^<>]*>,imsS"
60 priority: -20 # avant !paragraphes
64 if_match: "/[{}]|\n[_-]|--/"
65 match: ['{', '}', '_', '-']
66 replace: ["\x1\x1", "\x1\x2", "\x1\x3", "\x1\x4"]
70 match: "/\n(----+|____+)/S"
71 replace: "\n\n\n<hr class=\"spip\" />\n\n\n"
73 priority: -20 # avant !paragraphes
77 replace: "\n<br />— "
79 priority: -20 # avant !paragraphes
86 priority: -20 # avant !paragraphes
89 match: "/(^|^\n|\n\n)_ +/S"
92 priority: -20 # avant !paragraphes
96 replace: "<br class='manualbr' />"
98 priority: -20 # avant !paragraphes
101 # raccourcis en [ABBR|abbreviation]
104 match: "/\[([^\|\[\]>]+)\|([^\|\]\{>]+)(?:\{([a-z]+)\})?\]/S"
106 replace: inserer_abbr
108 intertitres-compliques:
109 # raccourcis imbriques en {{{{..}}}}
111 match: ['/(^|[^{])[{][{][{]/S', '/[}][}][}]($|[^}])/S']
112 replace: ["$1\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n$1"]
116 # raccourcis en {{{..}}}
118 match: ['{{{', '}}}']
119 replace: ["\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n"]
124 # raccourcis en {{..}}
127 replace: ['<strong>', '</strong>']
135 replace: ['<i>', '</i>']
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']
149 match: ['<quote>', '</quote>']
150 replace: ['<blockquote class="spip"><p>', '</blockquote><p>']
155 # suppr raccourci <intro>
156 # + suppression de <intro>
157 match: ['<intro>', '</intro>']
163 # eliminer les br restant en debut de texte
164 match: "@^\n<br />@S"
167 priority: -20 # avant !paragraphes
172 # utilise une callback
173 match: ",<poe(sie|try)>(.*)</poe(sie|try)>,UimsS"
174 replace: spip/spip-poesie.yaml
181 # voir echappe-tags ci-dessus
183 match: ["\x1\x1", "\x1\x2", "\x1\x3", "\x1\x4"]
184 replace: ['{', '}', '_', '-']
187 echappe-chevron-solitaire:
188 # un < qui n'est pas suivi d'une lettre ou d'un / est toujours echappe
190 match: "/<(?=[^a-z\/!])/Uims"
193 echappe-chevron-pas-ferme:
194 # un < suivi d'une lettre ou d'un / est echappe si il semble mal ferme
196 match: "/<([^><\"'!]*)(?=<|$)/Uims"