Bug 503718 - Automatic insertion of `<br>`/`<p>` elements with custom HTML templates in KMail Insertion automatique de `<br>`/`<p>` parasites avec les modèles personnalisés HTML dans KMail
Summary: Automatic insertion of `<br>`/`<p>` elements with custom HTML templates in KM...
Status: RESOLVED DUPLICATE of bug 368394
Alias: None
Product: kmail2
Classification: Applications
Component: composer (other bugs)
Version First Reported In: 6.4.0
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-03 17:49 UTC by Frédéric CUIF
Modified: 2026-01-17 13:21 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frédéric CUIF 2025-05-03 17:49:43 UTC
Objet : Insertion automatique de `<br>`/`<p>` parasites avec les modèles personnalisés HTML dans KMail  

**Description** :  
Lors de l'utilisation de modèles personnalisés HTML avec `%QUOTE`, KMail insère systématiquement des balises `<br>` et `<p>` vides avant/après le texte cité, générant des espaces indésirables. Ces espaces persistent malgré les tentatives de suppression via CSS inline ou structure HTML optimisée.  

**Environnement** :  
- KMail 6.4.0 (KDE Plasma 6)  
- Fedora Linux 41 (Wayland)  
- Modèle HTML testé : [coller votre modèle ici]  

**Attendu** :  
Un contrôle total sur les marges/paddings via le modèle HTML, sans insertion automatique de balises.  

**Observé** :  
Espaces incontrôlables dus à l'ajout de `<p style="margin:40px">` et `<br>` par KMail.  

**Liens connexes** :  
- Bug #317803 (problèmes de rendu HTML)  
- Bug #482445 (limitations du moteur QtWebEngine)  

**Proposition** :  
Ajouter une option pour désactiver l'insertion automatique de balises autour de `%QUOTE` ou permettre un CSS plus agressif (ex. `!important`).
Comment 1 Frédéric CUIF 2025-05-03 17:54:38 UTC
modèle utilisé :

%REM="Modèle compact KMail"%-
<div style="font-weight: bold; margin-bottom: 8px;">Le %ODATE,%OTIME %OFROMNAME a écrit :</div>
<table cellpadding="0" cellspacing="0" style="background:#f8f8f8; border:1px solid #d0d0d0; width:100%; margin:0;">
<tr>
<td style="color:#002060; font-style:italic; padding:8px 12px; margin:0;">
%QUOTE
</td>
</tr>
</table>
%CURSOR
Comment 2 Laurent Montel 2025-05-04 08:08:21 UTC
hi,
I will look at it soon.
Regards
Comment 3 aristsakas 2026-01-17 13:20:27 UTC
Translation 
Subject: Automatic insertion of unwanted `<br>`/`<p>` tags with custom HTML templates in KMail

**Description**:
When using custom HTML templates with `%QUOTE`, KMail systematically inserts empty `<br>` and `<p>` tags before and after the quoted text, generating unwanted spaces. These spaces persist despite attempts to remove them using inline CSS or optimized HTML structure.

**Environment**:
- KMail 6.4.0 (KDE Plasma 6)
- Fedora Linux 41 (Wayland)
- Tested HTML template: [paste your template here]

**Expected**:
Full control over margins/padding via the HTML template, without automatic tag insertion.

**Observed**: Uncontrolled spaces due to the addition of `<p style="margin:40px">` and `<br>` by KMail.
Comment 4 aristsakas 2026-01-17 13:21:55 UTC

*** This bug has been marked as a duplicate of bug 368394 ***