Fix string split for unhighlighted files
gitile/code.scm
45 | 45 | ||
46 | 46 | (define (split-lines content) | |
47 | 47 | (let loop ((content content) (result '()) (line '())) | |
48 | - | (match (pk 'split-lines-content content) | |
48 | + | (match content | |
49 | 49 | ((? string? s) (string-split s #\newline)) | |
50 | 50 | (() (append result (list line))) | |
51 | 51 | (((? string? s) content ...) | |
… | |||
78 | 78 | '())))))))) | |
79 | 79 | ||
80 | 80 | (define (split-tr content) | |
81 | - | (pk 'split-tr content) | |
82 | 81 | (let loop ((result '()) (lines (split-lines content)) (line-num 1)) | |
83 | 82 | (match lines | |
84 | 83 | (() result) |
gitile/highlight/utils.scm
8 | 8 | ||
9 | 9 | (define (flatten-highlights highlights) | |
10 | 10 | (define (flatten-highlights-aux content tokens) | |
11 | - | (pk 'content content 'tokens tokens) | |
12 | 11 | (match content | |
13 | 12 | ((? string? s) (if (null? tokens) | |
14 | - | s | |
13 | + | (list s) | |
15 | 14 | `((,@tokens ,s)))) | |
16 | 15 | (((? symbol? token) content ...) | |
17 | 16 | (flatten-highlights-aux content (cons token tokens))) | |
18 | 17 | ((? list? content) | |
19 | 18 | (append-map (lambda (c) (flatten-highlights-aux c tokens)) content)))) | |
20 | 19 | ||
21 | - | (pk 'content highlights) | |
22 | 20 | (flatten-highlights-aux highlights '())) | |
23 | 21 | ||
24 | 22 | (define (highlights->sxml highlights) | |
… | |||
27 | 25 | (define (tag->class tag) | |
28 | 26 | (string-append "syntax-" (symbol->string tag))) | |
29 | 27 | ||
30 | - | (pk 'highlights flat-highlights) | |
31 | - | ||
32 | 28 | (map (match-lambda | |
33 | 29 | ((? string? str) str) | |
34 | 30 | ((content ...) | |
… | |||
64 | 60 | (if tag | |
65 | 61 | (lambda (tokens cursor) | |
66 | 62 | (let-values (((result remainder) (consume-until empty-tokens cursor))) | |
67 | - | (values (pk (token-add tokens (list tag (tokens->list result)))) remainder))) | |
63 | + | (values (token-add tokens (list tag (tokens->list result))) remainder))) | |
68 | 64 | consume-until)) |