aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-09-29 12:06:31 +1000
committerYuchen Pei <hi@ypei.me>2022-09-29 12:06:31 +1000
commit968100499cabf0c3d27c8d2df6a08b957102ac30 (patch)
tree3b04967166f5b0b4f3c078ec625648d83aab127b
parent71a93991a03f0e9ea9b381d1a9d1acb994fc4a4d (diff)
fixing source code in documentation
-rw-r--r--hcel-utils.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/hcel-utils.el b/hcel-utils.el
index a35a441..df76f2a 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)