138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
|
-
+
|
(define link-urls (make-hash))
;; Provided tag functions:
(define (html-link . args)
`(link& [[ref ,(format "~a" (first args))]] ,@(rest args)))
(define (html-url ref url)
(hash-set! link-urls (format "~a" ref) url))
(hash-set! link-urls (format "~a" ref) url) "")
;; Private use (by html-root):
(define (decode-link-urls tx)
(cond [(eq? (get-tag tx) 'link&)
(let* ([url-ref (attr-ref tx 'ref)]
[url (or (hash-ref link-urls url-ref #f)
(format "Missing reference: ~a" url-ref))])
|