diff --git a/ecrire/inc/documents.php b/ecrire/inc/documents.php
index 4c4ac8d9e986bb58177b18c95c67362620f4a56e..265e59f8aa17d4fbef75eb02d9e5403db4d5d0f2 100644
--- a/ecrire/inc/documents.php
+++ b/ecrire/inc/documents.php
@@ -374,7 +374,8 @@ function integre_image($id_document, $align, $type_aff) {
 	# mode <span ...> : ne pas mettre d'attributs de type block sinon MSIE Windows refuse de faire des liens dessus
 	if ($span == 'span') {
 		$vignette = inserer_attribut($vignette, 'style', $float.'width:'.$width.'px;');
-		$vignette = inserer_attribut($vignette, 'class', "spip_document_$id_document spip_documents$class_align");
+		#$vignette = inserer_attribut($vignette, 'class', "spip_document_$id_document spip_documents$class_align");
+		$vignette = "<span class='spip_document_$id_document spip_documents$class_align'>$vignette</span>";
 		return $vignette;
 	}
 	# mode <div ...>
@@ -384,7 +385,8 @@ function integre_image($id_document, $align, $type_aff) {
 			// mettre au moins 120px
 			if (strlen($txt) AND $width < 120) $width = 120;
 			$width = 'width: '.$width.'px;';
-			$style = " style='$float$width'";
+			if (strlen($style = "$float$width"))
+				$style = " style='$style'";
 		}
 		return
 			"<div class='spip_document_$id_document spip_documents$class_align'$style>"
diff --git a/ecrire/inc/filtres.php b/ecrire/inc/filtres.php
index 2c39fc6ac8b3ee8ef982272a0c679b57408e4ff2..663c0fcfb25a3d4dacbd48ae5c44be6e19e68b59 100644
--- a/ecrire/inc/filtres.php
+++ b/ecrire/inc/filtres.php
@@ -827,10 +827,11 @@ function reduire_image($texte, $taille = -1, $taille_y = -1) {
 				// En cas de span spip_documents, modifier le style=...width:
 				if($tag[1]
 				AND $w = extraire_attribut($reduit, 'width')) {
-					$texte = str_replace($tag[1],
-						inserer_attribut($tag[1], 'style', 
-						preg_replace(", width: *\d+px,", " width: ${w}px",
-						extraire_attribut($tag[1], 'style'))), $texte);
+					$style = preg_replace(", width: *\d+px,", " width: ${w}px",
+						extraire_attribut($tag[1], 'style'));
+					$replace = inserer_attribut($tag[1], 'style', $style);
+					$replace = str_replace(" style=''", '', $replace);
+					$texte = str_replace($tag[1], $replace, $texte);
 				}
 
 				$texte = str_replace($tag[3], $reduit, $texte);