bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#22786: 25.1.50; eww arabic rendering


From: Lars Ingebrigtsen
Subject: bug#22786: 25.1.50; eww arabic rendering
Date: Tue, 01 Mar 2016 10:56:38 +1100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> Removing the hardcoded value is probably a good idea (but maybe use it
> as fallback if the HTML tag doesn't specify anything?).

That's what it currently does.  I think I'm going to just have it
default to nil, and we'll see whether this makes things render badly in
practice.  My uninformed guess is that pages that mix scripts (like
Wikipedia) will explicitly say that the paragraph direction is
left-to-right, while pages with (mostly) only left-to-right (most pages)
and right-to-left (Al Jazeera) are the ones that leave out the spec, so
things should work out fine.

But we'll see.

> However, note that support for this in shr is currently incomplete.
> First, there's a 3rd value, "auto", which is unsupported -- it should
> set bidi-paragraph-direction to nil.

I've now added this to shr.

> So I think for best results we should add support for the remaining
> bidi directives.  Adding support for "dir=auto" in the HTML tag is
> almost trivial.  To support the rest of the directives you need to add
> bidirectional formatting control characters before and/or around the
> text that is marked with these directives.  (If needed, I can provide
> the details about the controls you need to insert in each case.)

I think I remember the control characters from past discussions.  But is
the dir attribute used much in practice?  I've tried to be very, very
restrictive in what features I add to the common paths in shr.  It's
already slow enough, and each new line of code in the common paths add
some slow down.  It's death by a thousand cuts.  :-) I don't oppose
adding support for this if it's really used a lot in the wild, but if
not, I'd rather not.

(The "dir" attribute can apply to (almost) any HTML element, so the code
to detect and react to it would go into `shr-descend', which is called
once for every single HTML node in the document.)

However, adding support for the <bdi> and <bdo> elements should be
trivial, and will cause no slowdown, so I'll add them now...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

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