[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does shr support HTML directional attributes?

From: Eli Zaretskii
Subject: Re: Does shr support HTML directional attributes?
Date: Tue, 05 May 2015 18:50:18 +0300

> From: Lars Magne Ingebrigtsen <address@hidden>
> Cc: address@hidden
> Date: Tue, 05 May 2015 02:59:43 +0200
> Eli Zaretskii <address@hidden> 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:


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 via email to

[Prev in Thread] Current Thread [Next in Thread]