Commit 1a99bd69 authored by Lars Ingebrigtsen's avatar Lars Ingebrigtsen

Default web pages to right-to-left

* 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).


(cherry picked from commit 9e089ec8)
parent 2d33a9ca
......@@ -713,7 +713,8 @@ the like."
(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)
(setq buffer-read-only t))
......@@ -1102,6 +1102,15 @@ ones, in case fg and bg are nil."
;;; Tag-specific rendering rules.
(defun shr-tag-html (dom)
(let ((dir (dom-attr dom 'dir)))
((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)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment