diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php
index 6334242d586036047d62a9d752de83da3b221127..9b6b188709b273fd53dc988291a2409526d23511 100644
--- a/ecrire/inc/filtres.php
+++ b/ecrire/inc/filtres.php
@@ -506,7 +506,7 @@ function taille_en_octets ($taille) {
 // Rend une chaine utilisable sans dommage comme attribut HTML
 // http://doc.spip.org/@attribut_html
 function attribut_html($texte) {
-	$texte = texte_backend(supprimer_tags($texte));
+	$texte = texte_backend(preg_replace(array(",\n,",",\s(?=\s),ms"),array(" ",""),textebrut($texte)));
 	$texte = str_replace(array("'",'"'),array(''', '"'), $texte);
 	
 	return preg_replace(array("/&(amp;|#38;)/","/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,5};)/"),array("&","&") , $texte);