unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode
@ 2017-09-14  1:40 Tim Landscheidt
  2017-09-14 16:45 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Landscheidt @ 2017-09-14  1:40 UTC (permalink / raw)
  To: 28454

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

In Gnus v5.13 (GNU Emacs 25.2.1), if I display HTML mails
that start with (cf. attachment for examplary spam):

| <html dir="rtl" […]

the *Article* buffer switches to RTL mode, i. e. all lines,
including headers, are right-aligned.  If I subsequently
display a plain text mail (or a HTML mail without "dir" at-
tribute), this state remains, i. e. all lines, including
headers, are still right-aligned.

After killing the *Article* buffer, displaying plain text
mails works as usual again.

[-- Attachment #2: 277937 --]
[-- Type: application/octet-stream, Size: 9439 bytes --]

X-From-Line: wvpvumrw@homesinutah.com  Wed Sep 13 10:37:30 2017
Return-path: <wvpvumrw@homesinutah.com>
Envelope-to: tim@tim-landscheidt.de
Delivery-date: Wed, 13 Sep 2017 11:46:31 +0000
Received: from [58.59.68.91] (port=36257 helo=78.47.87.37)
	by mezzogiorno.tim-landscheidt.de with smtp (Exim 4.84_2)
	(envelope-from <wvpvumrw@homesinutah.com>)
	id 1ds67i-0000ol-Ub
	for tim@tim-landscheidt.de; Wed, 13 Sep 2017 11:46:31 +0000
X-Message-Info: FEYYqRF82nSmfHVZv67a5MI6TKLgjSEd
Received: from ljhxfpu15.bigbanners.com ([120.214.32.208]) by hi8-b23.bigbanners.com with Microsoft SMTPSVC(5.0.2195.6824);
	 Wed, 13 Sep 2017 05:39:30 -0700
Received: from ampexflutterinstrumentationlb36 (cringe[189.244.0.214])
          by bigbanners.com (fxiieej06) with SMTP
          id <56842684633939829442aex6b>
          (Authid: BobbieGreer);
          Wed, 13 Sep 2017 06:45:30 -0600
From: "Amelia Burnette" <wvpvumrw@homesinutah.com>
To: "'Tim'" <tim@tim-landscheidt.de>
Subject: Feel too old for having hot passionate sex? Try Penisole.
Date: Wed, 13 Sep 2017 10:37:30 -0200
X-Gnus-Mail-Source: pop:tim@mezzogiorno.tim-landscheidt.de
Message-ID: <172789n9ww59$7p7g2677$41k3wfhf@bentonvelasquezindeterminateml45>
MIME-Version: 1.0
Content-Type: text/html;
Content-Transfer-Encoding: 7Bit
X-Content-Length: 8068
Lines: 73
Xref: passepartout.tim-landscheidt.de mail.inbox:277937


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="rtl" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<style type="text/css">
  body, .mainTable { height:100% !important; width:100% !important; margin:0; padding:0; }
  img, a img { border:0; outline:none; text-decoration:none; }
  .imageFix { display:block; }
  table, td { border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;}
  p {margin:0; padding:0; margin-bottom:0;}
  .ReadMsgBody{width:100%;} .ExternalClass{width:100%;}
  .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div{line-height:100%;}
  img{-ms-interpolation-mode: bicubic;}
  body, table, td, p, a, li, blockquote{-ms-text-size-adjust:100%; -webkit-text-size-adjust:100%;}
</style>
<!--[if gte mso 9]>
<xml>
  <o:OfficeDocumentSettings>
    <o:AllowPNG/>
    <o:PixelsPerInch>96</o:PixelsPerInch>
  </o:OfficeDocumentSettings>
</xml>
<![endif]-->
</head>
<body scroll="auto" style="padding:0; margin:0; FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif; cursor:auto; background:#f0f8ff">
<TABLE class=mainTable cellSpacing=0 cellPadding=0 width="100%" bgColor=#f0f8ff>
<TR>
<TD style="FONT-SIZE: 0px; HEIGHT: 20px; LINE-HEIGHT: 0">&#160;</TD></TR>
<TR>
<TD vAlign=top>
<TABLE style="WIDTH: 600px; MARGIN: 0px auto" cellSpacing=0 cellPadding=0 width=600 align=center border=0 %CUSTOM_bitlymusor2 %CUSTOM_bitlymusor1 %CUSTOM_bitlymusor3 %CUSTOM_bitlymusor4 http://bit.ly/2xXOLxi >
<TR>
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 1px; PADDING-TOP: 1px; PADDING-LEFT: 0px; BORDER-LEFT: medium none; PADDING-RIGHT: 0px; BACKGROUND-COLOR: transparent">
<TABLE style="WIDTH: 100%" cellSpacing=0 cellPadding=0 align=left>
<TR style="HEIGHT: 1px">
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; WIDTH: 100%; VERTICAL-ALIGN: top; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 1px; TEXT-ALIGN: center; PADDING-TOP: 1px; PADDING-LEFT: 15px; BORDER-LEFT: medium none; PADDING-RIGHT: 15px; BACKGROUND-COLOR: transparent">
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 14px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #7c7c7c; MARGIN-TOP: 0px; LINE-HEIGHT: 125%; BACKGROUND-COLOR: transparent; mso-line-height-rule: exactly" dir=ltr align=center>If you can't read this email, please view it online http://bit.ly/2f81Ihd</P></TD></TR></TABLE></TD></TR>
<TR>
<TD style="BORDER-TOP: #dbdbdb 1px solid; BORDER-RIGHT: #dbdbdb 1px solid; BORDER-BOTTOM: #dbdbdb 1px solid; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; BORDER-LEFT: #dbdbdb 1px solid; PADDING-RIGHT: 0px; BACKGROUND-COLOR: #dbdbdb">
<TABLE style="WIDTH: 100%" cellSpacing=0 cellPadding=0 align=left>
<TR style="HEIGHT: 20px">
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; WIDTH: 50%; VERTICAL-ALIGN: top; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 35px; TEXT-ALIGN: center; PADDING-TOP: 35px; PADDING-LEFT: 15px; BORDER-LEFT: medium none; PADDING-RIGHT: 15px; BACKGROUND-COLOR: #feffff">
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 18px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #a8a7a7; MARGIN-TOP: 0px; LINE-HEIGHT: 155%; BACKGROUND-COLOR: #feffff; mso-line-height-rule: exactly" align=left>&#160;</P>
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; MARGIN-TOP: 0px; LINE-HEIGHT: 155%; BACKGROUND-COLOR: transparent; mso-line-height-rule: exactly" dir=ltr align=center>Hello!   The leading online store  is pleased to offer you  our product list  with delivery service in Europe, the United States and Canada. <BR>You can buy anti-acidity, antibiotics, blood pressure, antifungals, anti-allergy/asthma, diabetes medication, herpes medication, anti-depressant, antifungals, antiviral and other various products.  Keep your eye out for discount  when purchasing</P>
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 12px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; MARGIN-TOP: 0px; LINE-HEIGHT: 155%; BACKGROUND-COLOR: transparent; mso-line-height-rule: exactly" dir=ltr align=center>&#160;&#160;&#160;<U><FONT style="FONT-SIZE: 15px; BACKGROUND-COLOR: #31acce"><A title="" style="TEXT-DECORATION: none; COLOR: #000000" href="http://bit.ly/2vKCwne">___Hot Offer___ </A></FONT></U></P></TD>
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; WIDTH: 50%; VERTICAL-ALIGN: top; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 35px; TEXT-ALIGN: center; PADDING-TOP: 35px; PADDING-LEFT: 15px; BORDER-LEFT: medium none; PADDING-RIGHT: 15px; BACKGROUND-COLOR: #feffff">
<TABLE cellSpacing=0 cellPadding=0 align=center border=0>
<TR>
<TD style="PADDING-BOTTOM: 2px; PADDING-TOP: 2px; PADDING-LEFT: 2px; PADDING-RIGHT: 2px" align=center>
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TR>
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; BACKGROUND-COLOR: transparent"><A href="about:http://bit.ly/2xSVUjt"><IMG style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; DISPLAY: block; BACKGROUND-COLOR: transparent" border=0 src="https://lh3.googleusercontent.com/-GNiqfOeo6E8/WZXgbLJTa7I/AAAAAAAAAPA/akr_htSXW30Ptlek-mnmJIGeU0WslmSDgCHMYCw/s0/06309.jpg" width=300 height=250 hspace="0" vspace="0"></A></TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD></TR>
<TR>
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; BORDER-LEFT: medium none; PADDING-RIGHT: 0px; BACKGROUND-COLOR: transparent">
<TABLE style="WIDTH: 100%" cellSpacing=0 cellPadding=0 align=left>
<TR style="HEIGHT: 20px">
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; WIDTH: 100%; VERTICAL-ALIGN: top; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 0px; TEXT-ALIGN: center; PADDING-TOP: 0px; PADDING-LEFT: 0px; BORDER-LEFT: medium none; PADDING-RIGHT: 0px; BACKGROUND-COLOR: transparent">
<DIV></DIV></TD></TR></TABLE></TD></TR>
<TR>
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 1px; PADDING-TOP: 1px; PADDING-LEFT: 0px; BORDER-LEFT: medium none; PADDING-RIGHT: 0px; BACKGROUND-COLOR: transparent">
<TABLE style="WIDTH: 100%" cellSpacing=0 cellPadding=0 align=left>
<TR style="HEIGHT: 10px">
<TD style="BORDER-TOP: medium none; BORDER-RIGHT: medium none; WIDTH: 100%; VERTICAL-ALIGN: top; BORDER-BOTTOM: medium none; PADDING-BOTTOM: 1px; TEXT-ALIGN: center; PADDING-TOP: 1px; PADDING-LEFT: 15px; BORDER-LEFT: medium none; PADDING-RIGHT: 15px; BACKGROUND-COLOR: transparent">
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 10px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #7c7c7c; MARGIN-TOP: 0px; LINE-HEIGHT: 125%; BACKGROUND-COLOR: transparent; mso-line-height-rule: exactly" align=left>If you want more information about our privacy policy, please visit <A style="COLOR: #7c7d7c" href="https://aws.amazon.com/">this page</A>.</P>
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 10px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #7c7c7c; MARGIN-TOP: 0px; LINE-HEIGHT: 125%; BACKGROUND-COLOR: transparent; mso-line-height-rule: exactly" align=left>If you no longer wish to receive these emails, simply click on the following link <A style="COLOR: #7c7d7c" href="https://aws.amazon.com/">Unsubscribe</A>.</P>
<P style="MARGIN-BOTTOM: 1em; FONT-SIZE: 10px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #7c7c7c; MARGIN-TOP: 0px; LINE-HEIGHT: 125%; BACKGROUND-COLOR: transparent; mso-line-height-rule: exactly" dir=ltr align=left>&#169;2017 Company. All rights reserved.</P></TD></TR></TABLE></TD></TR></TABLE></TD></TR>
<TR>
<TD style="FONT-SIZE: 0px; HEIGHT: 8px; LINE-HEIGHT: 0">&#160;</TD></TR></TABLE>
</body>
</html>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode
  2017-09-14  1:40 bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode Tim Landscheidt
@ 2017-09-14 16:45 ` Eli Zaretskii
  2017-09-16  3:27   ` Tim Landscheidt
  0 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2017-09-14 16:45 UTC (permalink / raw)
  To: Tim Landscheidt; +Cc: 28454

> From: Tim Landscheidt <tim@tim-landscheidt.de>
> Date: Thu, 14 Sep 2017 01:40:41 +0000
> 
> In Gnus v5.13 (GNU Emacs 25.2.1), if I display HTML mails
> that start with (cf. attachment for examplary spam):
> 
> | <html dir="rtl" […]
> 
> the *Article* buffer switches to RTL mode, i. e. all lines,
> including headers, are right-aligned.  If I subsequently
> display a plain text mail (or a HTML mail without "dir" at-
> tribute), this state remains, i. e. all lines, including
> headers, are still right-aligned.
> 
> After killing the *Article* buffer, displaying plain text
> mails works as usual again.

It sounds like Gnus is reusing the *Article* buffer, in which case it
should reset bidi-paragraph-direction to nil before displaying a new
article.  As a workaround, you can do that manually when the problem
happens.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode
  2017-09-14 16:45 ` Eli Zaretskii
@ 2017-09-16  3:27   ` Tim Landscheidt
  2017-09-19  8:22     ` Tim Landscheidt
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Landscheidt @ 2017-09-16  3:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 28454

Thanks, Eli.  I've inserted:

| (lambda nil
|   (gnus-with-article-buffer
|     (setq bidi-paragraph-direction nil)))

at the top of gnus-article-decode-hook as a temporary work-
around, and it seems to work.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode
  2017-09-16  3:27   ` Tim Landscheidt
@ 2017-09-19  8:22     ` Tim Landscheidt
  2017-09-30 13:42       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Landscheidt @ 2017-09-19  8:22 UTC (permalink / raw)
  To: control; +Cc: 28454

[-- Attachment #1: Type: text/plain, Size: 221 bytes --]

tags 28454 + patch
thanks

The attached patch against emacs-25 seems to work for me.
Due to Gnus's undocumentedness, it's a big stab in the dark,
but it resets bidi-paragraph-direction for all test cases in
my inbox :-).

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: emacs-gnus-bidi-paragraph-direction.patch --]
[-- Type: text/x-patch, Size: 1073 bytes --]

From b4f2640d28769abdd6d6ea7380818ddf986bfb5d Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <tim@tim-landscheidt.de>
Date: Sun, 17 Sep 2017 05:20:21 +0000
Subject: [PATCH] Reset bidi-paragraph-direction on article rendering

* lisp/gnus/gnus-art.el: Reset bidi-paragraph-direction on article rendering
(Bug#28454).
---
 lisp/gnus/gnus-art.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 60b6a371..d7c7391 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -7052,6 +7052,7 @@ gnus-request-article-this-buffer
 	(save-excursion
 	  (erase-buffer)
 	  (gnus-kill-all-overlays)
+	  (setq bidi-paragraph-direction nil)
 	  (setq group (or group gnus-newsgroup-name))
 
 	  ;; Using `gnus-request-article' directly will insert the article into
@@ -7159,6 +7160,7 @@ gnus-request-article-this-buffer
 	      (while (not result)
 		(erase-buffer)
 		(gnus-kill-all-overlays)
+		(setq bidi-paragraph-direction nil)
 		(let ((gnus-newsgroup-name group))
 		  (gnus-check-group-server))
 		(cond
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode
  2017-09-19  8:22     ` Tim Landscheidt
@ 2017-09-30 13:42       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2017-09-30 13:42 UTC (permalink / raw)
  To: Tim Landscheidt; +Cc: 28454-done

> From: Tim Landscheidt <tim@tim-landscheidt.de>
> Date: Tue, 19 Sep 2017 08:22:50 +0000
> Cc: 28454@debbugs.gnu.org
> 
> The attached patch against emacs-25 seems to work for me.
> Due to Gnus's undocumentedness, it's a big stab in the dark,
> but it resets bidi-paragraph-direction for all test cases in
> my inbox :-).

Thanks.  As there were no comments, I've now pushed this to the
release branch, and I'm marking this bug done.

> * lisp/gnus/gnus-art.el: Reset bidi-paragraph-direction on article rendering
> (Bug#28454).

Please in the future include the name of the modified function(s) (in
parentheses) in the log message.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-30 13:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-14  1:40 bug#28454: RTL HTML causes *Article* buffer to be stuck in RTL mode Tim Landscheidt
2017-09-14 16:45 ` Eli Zaretskii
2017-09-16  3:27   ` Tim Landscheidt
2017-09-19  8:22     ` Tim Landscheidt
2017-09-30 13:42       ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).