summaryrefslogtreecommitdiff
path: root/syntax-highlight.scm
diff options
context:
space:
mode:
Diffstat (limited to 'syntax-highlight.scm')
-rw-r--r--syntax-highlight.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/syntax-highlight.scm b/syntax-highlight.scm
index 4326a4c..265ff37 100644
--- a/syntax-highlight.scm
+++ b/syntax-highlight.scm
@@ -61,6 +61,12 @@ corresponding to the highlighting tag name."
(map (match-lambda
((? string? str) str)
- ((tag text)
- `(span (@ (class ,(tag->class tag))) ,text)))
+ ((content ...)
+ (let loop ((tags '()) (text "") (content content))
+ (match content
+ (() `(span (@ (class ,(string-join (map tag->class tags) " "))) ,text))
+ (((? symbol? tag) content ...)
+ (loop (cons tag tags) text content))
+ (((? string? s) content ...)
+ (loop tags (string-append text s) content))))))
highlights))