emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 3dd82d7 3/3: Support <bdo> and <bdi>


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 3dd82d7 3/3: Support <bdo> and <bdi>
Date: Tue, 01 Mar 2016 00:27:46 +0000

branch: master
commit 3dd82d7501a28c1ac6cebb9a2fc14399413b5c40
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Support <bdo> and <bdi>
    
    * lisp/net/shr.el (shr-tag-bdo): New function.
    (shr-tag-bdi): Ditto.
---
 lisp/net/shr.el |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index ab04b9a..c469e69 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -1681,6 +1681,24 @@ The preference is a float determined from 
`shr-prefer-media-type'."
       (shr-colorize-region start (point) color
                           (cdr (assq 'background-color shr-stylesheet))))))
 
+(defun shr-tag-bdo (dom)
+  (let* ((direction (dom-attr dom 'dir))
+         (char (cond
+                ((equal direction "ltr")
+                 #x202d)                ; LRO
+                ((equal direction "rtl")
+                 #x202e))))             ; RLO
+    (when char
+      (insert char))
+    (shr-generic dom)
+    (when char
+      (insert #x202c))))                ; PDF
+
+(defun shr-tag-bdi (dom)
+  (insert #x2068)                       ; FSI
+  (shr-generic dom)
+  (insert #x2069))                      ; PDI
+
 ;;; Table rendering algorithm.
 
 ;; Table rendering is the only complicated thing here.  We do this by



reply via email to

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