4 * transforme un raccourci de ressource en un lien minimaliste
9 define('_EXTRAIRE_RESSOURCES', ',' . '<"?(https?://|[^\s][\w -]+\.[\w -]+)[^<]*>'.',UimsS');
12 function traiter_ressources($r) {
14 if ($ressource = charger_fonction('ressource', 'inc', true)) {
15 $html = $ressource($r[0]);
19 include_spip('inc/lien');
20 $url = explode(' ', trim($r[0], '<>'));
22 # <http://url/absolue>
23 if (preg_match(',^https?://,i', $url))
24 $html = PtoBR(propre("<span class='ressource spip_out'><[->".$url."]></span>"));
26 else if (false !== strpos($url, '/'))
27 $html = PtoBR(propre("<span class='ressource spip_in'><[->".$url."]></span>"));
30 preg_match(',\.([^.]+)$,', $url, $regs);
31 if (file_exists($f = _DIR_IMG
.$regs[1].'/'.$url)) {
32 $html = PtoBR(propre("<span class='ressource spip_in'><[".$url."->".$f."]></span>"));
34 $html = PtoBR(propre("<span class='ressource'><".$url."></span>"));
39 return '<html>'.$html.'</html>';