[pbs-devel] [PATCH proxmox-backup] email_notifications: make html template more valid

Dominik Csapak d.csapak at proxmox.com
Wed Nov 30 15:26:11 CET 2022


some thoughts:

i don't think 'more valid' is possible, either the markup is valid or not

On 11/29/22 17:40, Stefan Sterz wrote:
> some webmail interfaces may behave unexpectedly if the html is
> invalid. thus, close tags and declare a language.

which webmail interfaces? and according to whom is the old invalid and the new valid?

i checked the html spec of the whatwg[0] and it seems to me that
empty tags ('head' too) can be omitted

also the 'lang' attribute is only recommended, not required

the correct closing of the tags good though

0: https://html.spec.whatwg.org/multipage/semantics.html

> 
> Signed-off-by: Stefan Sterz <s.sterz at proxmox.com>
> ---
>   src/server/email_notifications.rs | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/server/email_notifications.rs b/src/server/email_notifications.rs
> index b3298cf9..378e805e 100644
> --- a/src/server/email_notifications.rs
> +++ b/src/server/email_notifications.rs
> @@ -294,7 +294,7 @@ fn send_job_status_mail(email: &str, subject: &str, text: &str) -> Result<(), Er
>       // Note: OX has serious problems displaying text mails,
>       // so we include html as well
>       let html = format!(
> -        "<html><body><pre>\n{}\n<pre>",
> +        "<html lang=\"en\"><head></head><body><pre>\n{}\n</pre></body></html>",
>           handlebars::html_escape(text)
>       );
>   






More information about the pbs-devel mailing list