On Wednesday, January 17, 2018 at 9:38:44 AM UTC-5, Komiya Takeshi wrote:
>
> Thanks, please report it. I'll investigate it when I have time. 
>

On further consideration, I suspect I know what is going on. I expect the 
TOC is using astext() at some point to get the section titles. This is 
normally TRTTD, however used on an XRefRole, it gives a "wrong" answer. 
Where this gets sticky is that astext() is also used in resolving external 
references (this, BTW, is where loops would have the chance to rear their 
heads).

I think there are two tricks to fixing this. First, the TOC needs to change 
to allow external references to leak through, so they can be resolved 
later. Second, said resolution needs to not itself produce references, 
since the TOC is already doing that for a different (and correct; the TOC 
should link to the section, not wherever the section title itself links) 
reference.

I will likely take a look at this if you don't beat me to it, so if you 
have any thoughts how you'd prefer to address this, so I don't spend time 
working on a "wrong" fix, that would be much appreciated. (For example, my 
first thought was to fiddle with astext(), but that comes from docutils, 
and a sphinx-only resolution is almost certainly preferred. OTOH, I'm not 
sure how to go about addressing this except to reimplement astext(), which 
risks falling apart in the face of esoteric implementations thereof.)

Thanks,

-- 
Matthew

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to