From 9858723403077a3db0a39d05f7329ef7d78c195d Mon Sep 17 00:00:00 2001 From: Shigeaki Matsumura Date: Sun, 23 Oct 2016 12:04:29 +0900 Subject: [PATCH] fix toc entry for title which has a link --- src/cryogen_core/toc.clj | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cryogen_core/toc.clj b/src/cryogen_core/toc.clj index f40cd35..0324c67 100644 --- a/src/cryogen_core/toc.clj +++ b/src/cryogen_core/toc.clj @@ -55,8 +55,12 @@ (let [anchor (or id name)] (if (nil? anchor) (recur zp (rest items)) - (recur (insert-toc-tree-entry - zp {:tag tag :anchor anchor :text (or title (first htext))}) + (recur (insert-toc-tree-entry zp + {:tag tag + :anchor anchor + :text (or + (if (string? title) title (-> title :content first)) + (first htext))}) (rest items)))) (z/root zp))))