Transformer les liens texte en liens hypertexte - comments fonction eregi_replace déprécie en PHP 5 2010-02-19T15:59:08Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment426654 2010-02-19T15:59:08Z <p>Voici une version actualisée de la fonction qui utilise preg_replace à la place de reregi_replace.</p> <p>Par ailleurs, la prise en compte des liens entre parenthèses (<a href="http://exemple.net" class="spip_url spip_out auto" rel="nofollow external">http://exemple.net</a>) a été jouée.</p> <div class="precode"><pre dir="ltr" style="text-align: left;" class="php"><code><span class="kw2">function</span> norm_liens<span class="br0">&#40;</span><span class="re0">$texte</span><span class="sy0">,</span> <span class="re0">$target</span><span class="sy0">=</span><span class="st_h">''</span><span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$target</span> <span class="sy0">=</span> <span class="st_h">'_'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">;</span> <span class="kw1">if</span> <span class="br0">&#40;</span> <span class="re0">$target</span> <span class="sy0">!=</span> <span class="st0">"_"</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ http://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="http://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">http://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ ftp://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="ftp://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ www.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="http://www.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">www.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ ftp.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="ftp://ftp.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(http://([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="http://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">http://$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(ftp://([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="ftp://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp://$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(www.([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="http://www.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">www.$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(ftp.([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="ftp://ftp.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp.$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^http://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="http://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">http://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^ftp://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="ftp://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^www.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="http://www.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">www.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^ftp.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="ftp://ftp.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">http://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="http://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">http://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">ftp://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="ftp://$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">www.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="http://www.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">www.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">ftp.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="ftp://ftp.$1" target="'</span><span class="sy0">.</span><span class="re0">$target</span><span class="sy0">.</span><span class="st_h">'">ftp.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="br0">&#125;</span> <span class="kw1">else</span> <span class="br0">&#123;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ http://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="http://$1">http://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ ftp://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="ftp://$1">ftp://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ www.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="http://www.$1">www.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@ ftp.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">' <a href="ftp://ftp.$1">ftp.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(http://([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="http://$1">http://$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(ftp://([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="ftp://$1">ftp://$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(www.([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="http://www.$1">www.$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@\(ftp.([^ <]*)\)@i'</span><span class="sy0">,</span> <span class="st_h">' (<a href="ftp://ftp.$1">ftp.$1</a>)'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^http://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="http://$1">http://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^ftp://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="ftp://$1">ftp://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^www.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="http://www.$1">www.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@^ftp.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="ftp://ftp.$1">ftp.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">http://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="http://$1">http://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">ftp://([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="ftp://$1">ftp://$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">www.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<p class="spip"><a href="http://www.$1">www.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'@<p class="spip">ftp.([^ <]*)@i'</span><span class="sy0">,</span> <span class="st_h">'<a href="ftp://ftp.$1">ftp.$1</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="br0">&#125;</span> <span class="re0">$texte</span> <span class="sy0">=</span> <a href="http://www.php.net/preg_replace" rel='nofollow'><span class="kw3">preg_replace</span></a><span class="br0">&#40;</span><span class="st_h">'#([^ >]*)@([^ ,:!?&<]*)#i'</span><span class="sy0">,</span> <span class="st_h">' <a href="mailto:$1@$2">$1@$2</a>'</span><span class="sy0">,</span> <span class="re0">$texte</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="kw1">return</span> <span class="re0">$texte</span><span class="sy0">;</span> <span class="br0">&#125;</span></code></pre></div> Transformer les liens texte en liens hypertexte 2007-04-19T00:34:53Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment393134 2007-04-19T00:34:53Z <p>Cette idée de transformer les liens texte en liens hypertexte a été concrétisée dans le plugin <a href='https://files.spip.org/archive-Tweak-SPIP' class="spip_in" hreflang="fr" rel='nofollow'>[archive] Tweak SPIP</a></p> Transformer les liens texte en liens hypertexte 2007-04-19T00:34:12Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment393133 2007-04-19T00:34:12Z <p>Ce code semble un peu lourd. Cette idée de transformer les liens texte en liens hypertexte a été concrétisée dans le plugin <a href='https://files.spip.org/archive-Tweak-SPIP' class="spip_in" hreflang="fr" rel='nofollow'>[archive] Tweak SPIP</a></p> Transformer les liens texte en liens hypertexte 2006-07-25T12:59:44Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment386689 2006-07-25T12:59:44Z <p>je suis pas en avance mais j'essaie de faire ca sur une version 1.9 et cela ne marche pas</p> <p>j'ai mes liens dans mes articles en version texte mais ils ne se changent pas en html</p> <p>est ce du a fichier mes_fonctions.php3 ?</p> > Transformer les liens texte en liens hypertexte 2005-09-20T15:37:20Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment383506 2005-09-20T15:37:20Z <p>un problème avec les url contenant des ?<br class="autobr" /> un espace est généré rendant la fonction inopérante pour spip</p> > Transformer les liens texte en liens hypertexte 2005-08-03T01:43:50Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment382659 2005-08-03T01:43:50Z <p>Oui c'est une très bonne contrib, très utile.</p> > Transformer les liens texte en liens hypertexte 2005-07-04T07:09:11Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment381995 2005-07-04T07:09:11Z <p>Filtre sympatique mais qui ne fonctionne pas correctement lorsque le lien se situe dans une note. cf résultat depuis le lien. A+.</p> > Transformer les liens texte en liens hypertexte 2005-04-04T08:02:18Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment380006 2005-04-04T08:02:18Z <p>pas autant pour moi, <a href="http://www.langue-fr.net/index/A/au_temps-autant.htm" class="spip_out" rel='nofollow external'>aux temps pour moi</a> .. ou à la rigueur <a href="http://www.langue-fr.net/index/A/au_temps-bis.htm" class="spip_out" rel='nofollow external'>aux tempes pour moi</a></p> > Transformer les liens texte en liens hypertexte 2004-03-27T13:52:47Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment7768 2004-03-27T13:52:47Z <p>>quand au site <a href="http://www.bellaciao.org" class="spip_url spip_out auto" rel="nofollow external">http://www.bellaciao.org</a>, il ne faut pas se >méprendre voir au contraire avec plus de renseignements, >ou alors <a href="http://paris.indymedia.org/articles.php3" class="spip_url spip_out auto" rel="nofollow external">http://paris.indymedia.org/articles.php3</a> ?>id_article=10000.</p> <p>je comprends pas ta phrase...</p> <p>“quand au site <a href="http://www.bellaciao.org" class="spip_url spip_out auto" rel="nofollow external">http://www.bellaciao.org</a>, il ne faut pas se >méprendre voir au contraire”</p> <p>:))</p> <p>Tip</p> > Transformer les liens texte en liens hypertexte 2004-02-23T16:11:35Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment6722 2004-02-23T16:11:35Z <p>Bonjour,</p> <p>je cherche à créer des liens externes à partir de la boucle DOCUMENTS. Le filtre “liens_ouvrants” n'a pas l'air de s'y appliquer. Et “norm_liens” non plus. Comment faire?</p> > Transformer les liens texte en liens hypertexte 2003-12-06T08:47:35Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4767 2003-12-06T08:47:35Z <p>Quelle idée aussi de mettre des virgules dans les URLs! ;-)</p> <p>Nan, sérieusement, je me pencherais sur les problèmes que tu cites lorsque j'aurai un peu de temps de moi...</p> > Transformer les liens texte en liens hypertexte 2003-12-04T16:37:42Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4740 2003-12-04T16:37:42Z <p>trés bon, voir même excellent, attention point trop n'en faut.</p> <p>dommage que spipcontrib ne l'utilise pas !</p> <p>http:\<a href="http://www.bachant.net" class="spip_url spip_out auto" rel="nofollow external">www.bachant.net</a></p> > Transformer les liens texte en liens hypertexte 2003-11-25T22:12:37Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4575 2003-11-25T22:12:37Z <p>autre point : les url complexes comme celle du monde avec des virgules donnet des résultats très bizarre. Essayez celle là :</p> <p>http://www.lemonde.fr/web/article/0,1-0@2-3218,36-343395,0.html</p> > Transformer les liens texte en liens hypertexte 2003-11-25T21:33:37Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4574 2003-11-25T21:33:37Z <p>milles excuses : pour l'exemple, voilà le texte original.<br class="autobr" /> les url doivent donc être séparées par des blancs. nb: une url entre parenthèses ne marche pas (pas clickable).<br class="autobr" /> la duxième url bellaciao ne marche pas (à cause de la virgule, de même pour la dernière adress indymedia, polluée par le point final de la phrase). Une adresse email marche (c'est chouette).</p> <p> http://www.bellaciao.org <br /> http://paris.indymedia.org/articles.php3?id_article=10000 <br /> quand au site http://www.bellaciao.org, il ne faut pas se méprendre voir au contraire (http://paris.indymedia.org/articles.php3?id_article=10000) avec plus de renseignements, ou alors http://paris.indymedia.org/articles.php3?id_article=10000. <br /> [et voir ça->http://www.bellaciao.org] <br /> mon email : jeppe@no-log.org </p> > Transformer les liens texte en liens hypertexte 2003-11-25T21:21:29Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4572 2003-11-25T21:21:29Z <p>attention, il y a quelques problèmes avec la ponctuation<br class="autobr" /> par exemple si l'adresse est suivie d'une virgule ou d'un point, cette virgule se trouve intégrée dans l'URL et provoque donc une erreur.</p> <p>Autre problème : il y a un conflit avec la façon dont spip gère la typographie, ainsi une url avec articles.php?id_article=100 verra un espace s'intercaler avant le ?, et là encore l'url ne marche plus.</p> <p>Exemple de test :</p> <p><a href="http://www.bellaciao.org" class="spip_url spip_out auto" rel="nofollow external">http://www.bellaciao.org</a></p> <p><a href="http://paris.indymedia.org/articles.php3?id_article=10000" class="spip_url spip_out auto" rel="nofollow external">http://paris.indymedia.org/articles.php3?id_article=10000</a></p> <p>quand au site <a href="http://www.bellaciao.org" class="spip_url spip_out auto" rel="nofollow external">http://www.bellaciao.org</a>, il ne faut pas se méprendre<br class="autobr" /> voir au contraire <span class="ressource spip_out"><<a href="http://paris.indymedia.org/articles.php3?id_article=10000" class="spip_url spip_out" rel='nofollow external'>http://paris.indymedia.org/articles...</a>></span> avec plus de renseignements, ou alors <a href="http://paris.indymedia.org/articles.php3?id_article=10000" class="spip_url spip_out auto" rel="nofollow external">http://paris.indymedia.org/articles.php3?id_article=10000</a>.</p> > Transformer les liens texte en liens hypertexte 2003-11-21T08:07:19Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4490 2003-11-21T08:07:19Z <p>Autant pour moi, après vérification il s'agit d'une option qui permet de rajouter une ligne lors de la saisie des articles pour ajouter un lien internet un peu comme ce qui existe déjà dans les brèves et les forums.</p> > Transformer les liens texte en liens hypertexte 2003-11-20T11:07:35Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4472 2003-11-20T11:07:35Z <p>C'est une option que j'ai vu dans la partie administration de SPIP 1.7b3 et qui s'appelle “liens hypertextes”.</p> <p>Je ne sais pas ce que signifie cette option (case à cocher) mais cela ressemble bigrement à cet article.</p> > Transformer les liens texte en liens hypertexte 2003-11-13T22:29:45Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4352 2003-11-13T22:29:45Z <p>Je n'ai rien vu à ce sujet dans la v1.7. Tu as vu ça où?</p> > Transformer les liens texte en liens hypertexte 2003-11-09T22:38:55Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4285 2003-11-09T22:38:55Z <p>Je ne sais pas. J'ai téléchargé la beta, j'irai voir...</p> > Compatibilité avec typo normale 2003-11-09T22:37:15Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4284 2003-11-09T22:37:15Z <p><cite>Et c'est compatible, si dans le reste du texte on y un lien du type :</cite></p> <p>Oui.</p> > Compatibilité avec typo normale 2003-11-09T21:31:50Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4283 2003-11-09T21:31:50Z <p>Excellent !</p> <p>Et c'est compatible, si dans le reste du texte on y un lien du type :</p> <div class="precode"><pre dir="ltr" style="text-align: left;" class=""><code>[Lien->www.lien.com]</code></pre></div> <p>?</p> <p>Yiannis</p> > Transformer les liens texte en liens hypertexte 2003-11-07T11:05:15Z https://files.spip.org/Transformer-les-liens-texte-en-liens-hypertexte#comment4253 2003-11-07T11:05:15Z <p>Me trompes-je ou c'est cette fonctionnalité qui est intégrée par défaut dans le futur SPIP1.7 ? (case à cocher dans la config de SPIP)</p>