fix link search to walk up sections, instead of using the global table
svn: r6264 original commit: 58828e96a1335c0611f0a5c4e793a4eb30b46667
This commit is contained in:
parent
f9019a651f
commit
7fb6f9e3f9
|
@ -131,6 +131,19 @@
|
|||
(list (index-element-plain-seq i)
|
||||
(index-element-entry-seq i))))
|
||||
|
||||
(define/public (lookup part ht key)
|
||||
(let ([v (hash-table-get (if part
|
||||
(collected-info-info (part-collected-info part))
|
||||
ht)
|
||||
key
|
||||
#f)])
|
||||
(or v
|
||||
(and part
|
||||
(lookup (collected-info-parent
|
||||
(part-collected-info part))
|
||||
ht
|
||||
key)))))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; render methods
|
||||
|
||||
|
@ -192,7 +205,7 @@
|
|||
(cond
|
||||
[(and (link-element? i)
|
||||
(null? (element-content i)))
|
||||
(let ([v (hash-table-get ht (link-element-tag i) #f)])
|
||||
(let ([v (lookup part ht (link-element-tag i))])
|
||||
(if v
|
||||
(render-content v part ht)
|
||||
(render-content (list "[missing]") part ht)))]
|
||||
|
@ -265,7 +278,7 @@
|
|||
(or (not (car number))
|
||||
((car number) . > . 1)))
|
||||
(cons (list (make-flow (list (make-paragraph (list
|
||||
(make-element 'hspace (list " ")))))))
|
||||
(make-element 'hspace (list "")))))))
|
||||
l)
|
||||
l))))
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
collect-part
|
||||
install-file
|
||||
get-dest-directory
|
||||
format-number)
|
||||
format-number
|
||||
lookup)
|
||||
|
||||
(define/override (get-suffix) #".html")
|
||||
|
||||
|
@ -131,7 +132,7 @@
|
|||
[(target-element? e)
|
||||
`((a ((name ,(target-element-tag e))) ,@(render-plain-element e part ht)))]
|
||||
[(link-element? e)
|
||||
(let ([dest (hash-table-get ht (link-element-tag e) #f)])
|
||||
(let ([dest (lookup part ht (link-element-tag e))])
|
||||
(if dest
|
||||
`((a ((href ,(format "~a~a~a"
|
||||
(from-root (car dest)
|
||||
|
|
Loading…
Reference in New Issue
Block a user