* eww.el (eww-mode): Most web pages are left-to-right, so make
that the default (bug#19801).
* shr.el (shr-tag-html): Respect "dir" attributes
(left-to-right, right-to-left).
Backport:
(cherry picked from commit
9e089ec8a380ec3758fcf1564c5f86dc92c68c2a)
(setq-local desktop-save-buffer #'eww-desktop-misc-data)
;; multi-page isearch support
(setq-local multi-isearch-next-buffer-function #'eww-isearch-next-buffer)
- (setq truncate-lines t)
+ (setq truncate-lines t
+ bidi-paragraph-direction 'left-to-right)
(buffer-disable-undo)
(setq buffer-read-only t))
;;; Tag-specific rendering rules.
+(defun shr-tag-html (dom)
+ (let ((dir (dom-attr dom 'dir)))
+ (cond
+ ((equal dir "ltr")
+ (setq bidi-paragraph-direction 'left-to-right))
+ ((equal dir "rtl")
+ (setq bidi-paragraph-direction 'right-to-left))))
+ (shr-generic dom))
+
(defun shr-tag-body (dom)
(let* ((start (point))
(fgcolor (or (dom-attr dom 'fgcolor) (dom-attr dom 'text)))