Hi,

You can see what happened via `make pseudoxml`. It dumps the
intermediate document structure as XML.

This is a part of generated XML from your snippet.
```
        <target refid="item-1">
        <enumerated_list enumtype="arabic" ids="item-1" names="item-1"
prefix="" suffix=".">
            <list_item>
                <paragraph>
                    Item 1
                <target refid="item-2">
            <list_item ids="item-2" names="item-2">
                <paragraph>
                    Item 2
```

There are two target nodes. First is placed before enumerated_list,
and another is placed at the tail of the first list_item.
And you can also see the ids attribute on the enumerated_list and the
second list_item.
Docutils automatically copies an ID from the target node to the subsequent node.

This is why your mark-up works.

2022年7月13日(水) 15:11 Steevie <[email protected]>:
>
> Hi Josué,
>
> On Tue, 12 Jul 2022 07:37:35 -0300, Josué Andrade Gomes wrote:
>
> > Hi,
> >
> > I’m trying to create a hyperlink to an autonumbered list item. The
> > hyperlink works fine but the items are not correctly numbered.
> >
> > Sample ------
> >
> > See: :ref:`This <item-1>` and :ref:`That <item-2>`
> >
> > Items -----
> >
> > .. _item-1:
> >
> > #. Item 1
> >
> > .. _item-2:
> >
> > #. Item 2
>
> I can confirm the behaviour, which indeed is a bit strange. However, I
> made a quick test with the second label indented and it works:
>
> .. _item-1:
>
> #. Item 1
>
>    .. _item-2:
>
> #. Item 2
>
>  Not sure this solution some unwanted side-effects, though!
>
> Hope this helps,
> Stefano
>
>
> --
> 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 view this discussion on the web visit 
> https://groups.google.com/d/msgid/sphinx-users/talnmd%24jc2%241%40ciao.gmane.io.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sphinx-users/CAFmkQANx9Cw8zZxjHi2dzEAJHi2nj7h%3DCtDJrf_YaK26uABR%3Dg%40mail.gmail.com.

Reply via email to