diff options
-rw-r--r-- | syntax-highlight.scm | 10 |
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)) |