emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/hcel 968100499c 2/2: fixing source code in documentatio


From: ELPA Syncer
Subject: [elpa] externals/hcel 968100499c 2/2: fixing source code in documentation
Date: Wed, 28 Sep 2022 22:57:41 -0400 (EDT)

branch: externals/hcel
commit 968100499cabf0c3d27c8d2df6a08b957102ac30
Author: Yuchen Pei <hi@ypei.me>
Commit: Yuchen Pei <hi@ypei.me>

    fixing source code in documentation
---
 hcel-utils.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hcel-utils.el b/hcel-utils.el
index a35a44191f..df76f2ae9e 100644
--- a/hcel-utils.el
+++ b/hcel-utils.el
@@ -151,7 +151,8 @@ Example of an idSrcSpan:
     (with-temp-buffer
       (insert html)
       (let ((shr-external-rendering-functions
-             '((span . hcel-tag-span))))
+             '((span . hcel-tag-span)
+               (div . hcel-tag-div))))
         (shr-render-region (point-min) (point-max)))
       (buffer-string))))
 
@@ -178,6 +179,11 @@ Example of an idSrcSpan:
 )))
      (dom-attributes dom))))
 
+(defun hcel-tag-div (dom)
+  (if (equal (dom-attr dom 'class) "source-code")
+      (shr-tag-pre dom)
+    (shr-tag-div dom)))
+
 (defun hcel-text-property-near-point (prop)
   "Find property prop at point, or just before point."
   (or (get-text-property (point) prop)



reply via email to

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