From 7f675ca5cdf10f4e6b0ec2696a8b81f5301a96b5 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 13 May 2020 08:16:30 +0200 Subject: view/utils: Hide "cut here" lines. --- mumi/web/view/utils.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm index 3695045..f863528 100644 --- a/mumi/web/view/utils.scm +++ b/mumi/web/view/utils.scm @@ -62,11 +62,12 @@ with the next context." other-blocks) context)) ((eq? context 'snippet) - (values (cons (add-block-line! block - `(span (@ (class "line")) ,line)) - other-blocks) - (if (string-prefix? "--8<---------------cut here" line) - #f context))) + (if (string-prefix? "--8<---------------cut here" line) + (values blocks #f) + (values (cons (add-block-line! block + `(span (@ (class "line")) ,line)) + other-blocks) + context))) ((eq? context 'diff) (if (string= "--" line) ;; Retry @@ -122,6 +123,8 @@ with the next context." `(span (@ (class "line commit changelog")) ,line)) ((string-prefix? "diff --git" line) `(span (@ (class "line diff file")) ,line)) + ((string-prefix? "--8<---------------cut here" line) + "") (else `(span (@ (class "line")) ,line))))) (if (eq? new-context context) -- cgit v1.2.3