racket / scribble

Other
194 stars 89 forks source link

Nested `deftech` fails to generate a link in Search Manual #423

Open NoahStoryM opened 2 months ago

NoahStoryM commented 2 months ago

What version of Racket are you using? 8.12 [cs]

What program did you run? Here is a snippet of my .scrbl file that seems to cause the issue:

@subsection{Commutative Diagram}

Informally, a @deftech{diagram} comprises various @tech{objects} connected by
various @tech{morphisms}. When the @tech{morphisms} with the same @tech{domain}
and @tech{codomain} are the same one, the @tech{diagram} is a
@deftech{@deftech{commutative} diagram}.

@tech{Commutative diagrams} serve as a powerful language for expressing equations.

@subsubsection{Commutative Triangle}

A @deftech{commutative triangle} is a @tech{commutative diagram} that has the shape
of a triangle.

What should have happened? The nested use of deftech should generate correct links in both the .html file and the Search Manual for all defined technical terms. Specifically, the term "commutative diagram" should be properly linked in the Search Manual like "commutative triangle".

If you got an error message, please include it here. No error message was displayed, but the expected link creation in the Search Manual was not observed for the nested deftech tags.

Please include any other relevant details

In .html: html

In Search Manual: search-manual

NoahStoryM commented 1 month ago

Below is the link-element generated from the expression @deftech{is a @deftech{test} here.}:

(link-element "indexlink"
              (list (element 'italic
                      (list "is a "
                            (index-element #f
                                           (target-element #f
                                                           (element 'italic "test")
                                                           '(tech "test"))
                                           '(tech "test")
                                           '("test")
                                           (list (element 'italic "test"))
                                           'tech)
                            " here."))
                    (element 'newline '("\n")))
              '(tech "is a test here."))

The result is as shown in the attached screenshot. Only the part "is a " (the first element of the list) is rendered correctly.

Screenshot_2024-05-09_23-39-10