* Does shr support HTML directional attributes?
@ 2015-05-04 16:57 Eli Zaretskii
2015-05-05 0:59 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-05-04 16:57 UTC (permalink / raw
To: Lars Magne Ingebrigtsen; +Cc: emacs-devel
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?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Does shr support HTML directional attributes?
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
0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 2015-05-05 0:59 UTC (permalink / raw
To: Eli Zaretskii; +Cc: emacs-devel
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. I think
there used to be support for the text-align style attribute in <td>
cells, but looking at shr.el now, that seems to have been lost during
the variable-width font rewrite.
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.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Does shr support HTML directional attributes?
2015-05-05 0:59 ` Lars Magne Ingebrigtsen
@ 2015-05-05 15:50 ` Eli Zaretskii
2015-05-06 20:57 ` Lars Magne Ingebrigtsen
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-05-05 15:50 UTC (permalink / raw
To: Lars Magne Ingebrigtsen; +Cc: emacs-devel
> 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?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-06 20:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2015-05-06 20:57 ` Lars Magne Ingebrigtsen
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.