all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Magne Ingebrigtsen <larsi@gnus.org>
Cc: emacs-devel@gnu.org
Subject: Re: Does shr support HTML directional attributes?
Date: Tue, 05 May 2015 18:50:18 +0300	[thread overview]
Message-ID: <83d22frpl1.fsf@gnu.org> (raw)
In-Reply-To: <m3wq0nltz4.fsf@gnus.org>

> From: Lars Magne Ingebrigtsen <larsi@gnus.org>
> Cc: emacs-devel@gnu.org
> Date: Tue, 05 May 2015 02:59:43 +0200
> 
> Eli Zaretskii <eliz@gnu.org> 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?



  reply	other threads:[~2015-05-05 15:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 16:57 Does shr support HTML directional attributes? Eli Zaretskii
2015-05-05  0:59 ` Lars Magne Ingebrigtsen
2015-05-05 15:50   ` Eli Zaretskii [this message]
2015-05-06 20:57     ` Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d22frpl1.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.