diff options
author | Gene Pasquet <dev@etenil.net> | 2025-03-13 23:44:19 +0000 |
---|---|---|
committer | Gene Pasquet <dev@etenil.net> | 2025-03-23 09:30:09 +0000 |
commit | 5bc74ac762926b4310569963e30cbf85f265dbcb (patch) | |
tree | a7725140020c18c7d8efe802b977e174e3fc28db /unhtml.lisp | |
parent | 3152e0420751a56e1e3a89687a3935f62151a18e (diff) |
Run summarize top statuses
Diffstat (limited to 'unhtml.lisp')
-rw-r--r-- | unhtml.lisp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/unhtml.lisp b/unhtml.lisp index 18bab64..6579203 100644 --- a/unhtml.lisp +++ b/unhtml.lisp @@ -10,6 +10,9 @@ (loop for c across (plump:child-elements dom) if (node-has-text c) collect c )) -(defun text-excerpt (content length) +(defun text-excerpt (content excerpt-length) (let ((text-nodes (text-children (plump:parse content)))) - (plump:text (first text-nodes)))) + (if text-nodes + (let ((text (plump:text (first text-nodes)))) + (subseq text 0 (min excerpt-length (length text)))) + nil))) |