From 96e955ea8c738ba5246191f59037de9802039395 Mon Sep 17 00:00:00 2001 From: Calvin Beck Date: Thu, 9 Sep 2021 09:10:46 -0400 Subject: [PATCH] Add a utility function for turning html strings into normal text. Could be useful for the json-ld issue brought up in #58. --- org-chef-utils.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/org-chef-utils.el b/org-chef-utils.el index aaeec43..c788155 100644 --- a/org-chef-utils.el +++ b/org-chef-utils.el @@ -47,6 +47,12 @@ (seq-filter (lambda (x) (not (stringp x))) (dom-children dom))) +(defun org-chef-render-html (text) + "Turn an html string into normal text." + (with-temp-buffer + (insert text) + (shr-render-buffer (current-buffer)) + (buffer-string))) (defun org-chef-insert-org-list (lst &optional bullet) "Insert LST as an ‘org-mode’ plain list.