aboutsummaryrefslogtreecommitdiff
path: root/unhtml.lisp
diff options
context:
space:
mode:
authorGene Pasquet <dev@etenil.net>2025-03-13 23:44:19 +0000
committerGene Pasquet <dev@etenil.net>2025-03-23 09:30:09 +0000
commit5bc74ac762926b4310569963e30cbf85f265dbcb (patch)
treea7725140020c18c7d8efe802b977e174e3fc28db /unhtml.lisp
parent3152e0420751a56e1e3a89687a3935f62151a18e (diff)
Run summarize top statuses
Diffstat (limited to 'unhtml.lisp')
-rw-r--r--unhtml.lisp7
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)))