From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Does shr support HTML directional attributes? Date: Tue, 05 May 2015 18:50:18 +0300 Message-ID: <83d22frpl1.fsf@gnu.org> References: <83sibcs2ki.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1430841055 21543 80.91.229.3 (5 May 2015 15:50:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 5 May 2015 15:50:55 +0000 (UTC) Cc: emacs-devel@gnu.org To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 05 17:50:45 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ypf7M-0006nX-UF for ged-emacs-devel@m.gmane.org; Tue, 05 May 2015 17:50:45 +0200 Original-Received: from localhost ([::1]:40063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypf7M-0001Ol-DN for ged-emacs-devel@m.gmane.org; Tue, 05 May 2015 11:50:44 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypf70-0001IF-2N for emacs-devel@gnu.org; Tue, 05 May 2015 11:50:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ypf6s-000852-JT for emacs-devel@gnu.org; Tue, 05 May 2015 11:50:21 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:58915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ypf6s-00084f-5W for emacs-devel@gnu.org; Tue, 05 May 2015 11:50:14 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NNV00G00VWYB100@a-mtaout20.012.net.il> for emacs-devel@gnu.org; Tue, 05 May 2015 18:50:12 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NNV00FFNVZNWRB0@a-mtaout20.012.net.il>; Tue, 05 May 2015 18:50:12 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:186242 Archived-At: > From: Lars Magne Ingebrigtsen > Cc: emacs-devel@gnu.org > Date: Tue, 05 May 2015 02:59:43 +0200 > > Eli Zaretskii writes: > > > I've just got a (spam) mail in Arabic whose portions were displayed > > left-aligned, which is not what the HTML payload wanted (it used > > dir=RTL and style='margin-right:.5in;text-align:right...'), which > > AFAIU should have caused the text rendered as right-to-left paragraph. > > > > Does shr support these attributes? > > Nope; shr doesn't support the "dir" attribute in elements. It looked like that, thanks for confirming. > shr is a pretty minimal HTML renderer -- it tries to be fast enough for > most web pages, but it doesn't try very hard to be an accurate HTML > renderer. There's tons of stuff it doesn't support, because it'd be too > slow. If you find a way to support those two elements without affecting > the general rendering speed, please go ahead and add support for them. To render this correctly, we should simply insert the appropriate directional control characters. E.g., this page: http://www.w3.org/International/questions/qa-bidi-unicode-controls provides part of the story (look under "Correspondences"). It's not the whole story, because text-align:right is not covered, but supporting that is similarly simple. Would it help if I provide an algorithmic description of what needs to be done?