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
90 replace: "<br class='manualbr' />"
92 priority: -20 # avant !paragraphes
95 # raccourcis en [ABBR|abbreviation]
98 match: "/\[([^\|\[\]>]+)\|([^\|\]\{>]+)(?:\{([a-z]+)\})?\]/S"
100 replace: inserer_abbr
102 intertitres-compliques:
103 # raccourcis imbriques en {{{{..}}}}
105 match: ['/(^|[^{])[{][{][{]/S', '/[}][}][}]($|[^}])/S']
106 replace: ["$1\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n$1"]
110 # raccourcis en {{{..}}}
112 match: ['{{{', '}}}']
113 replace: ["\n\n\n<h3 class=\"spip\">", "</h3>\n\n\n"]
118 # raccourcis en {{..}}
121 replace: ['<strong>', '</strong>']
129 replace: ['<i>', '</i>']
135 # lignes vides consecutives, br imbriques dans des p
136 # mais attention pas les br trop riches (ex: br style=clear:both)
137 match: ["/ *\n(?: *\n)+(?:<br ?\/?>)*/S", '/(?:<br\b[^>]*>){2,}\s*/S', "/(<p\b[^>]*>)\n*(?:<br ?\/?>\n*)+/S"]
138 replace: ['<p>', '<p>', '$1']
143 match: ['<quote>', '</quote>']
144 replace: ['<blockquote class="spip"><p>', '</blockquote><p>']
149 # suppr raccourci <intro>
150 # + suppression de <intro>
151 match: ['<intro>', '</intro>']
157 # eliminer les br restant en debut de texte
158 match: "@^\n<br />@S"
161 priority: -20 # avant !paragraphes
166 # utilise une callback
167 match: ",<poe(sie|try)>(.*)</poe(sie|try)>,UimsS"
168 replace: spip/spip-poesie.yaml
175 # voir echappe-tags ci-dessus
177 match: ["\x1\x1", "\x1\x2", "\x1\x3", "\x1\x4"]
178 replace: ['{', '}', '_', '-']