Markdown: how to refer to an item in a numbered list, by number (e.g. LaTeX \ ref / \ label)?

Is there a markdown way to make cross-reference equivalent in this LaTeX fragment? (Taken from here .)

\begin{enumerate}
    \item \label{itm:first} This is a numbered item
    \item Another numbered item \label{itm:second}
    \item \label{itm:third} Same as \ref{itm:first}
\end{enumerate}
Cross-referencing items \ref{itm:second} and \ref{itm:third}.

This LaTeX produces

1. This is a numbered item
2. This is another numbered item
3. Same as 1

Cross-referencing items 2 and 3.

That is, I would like to be able to refer to the items in the markdown list without explicitly numbering them, so that I can change the above list to the following ones, without having to manually update cross-references:

1. This is the very first item
2. This is a numbered item
3. This is another numbered item
4. Same as 2

Cross-referencing items 3 and 4.
+4
source share
2 answers

HTML can't even do this, and Markdown is a subset of HTML, so the answer is no.

For example, your list will be presented like this (when rendering Markdown):

<ol>
    <li>This is a numbered item</li>
    <li>This is another numbered item</li>
    <li>Same as 1</li>
</ol>

, , . . , . .

HTML, :

<ol>
    <li id="item1">This is a numbered item</li>
    <li id="item2">This is another numbered item</li>
    <li id="item3">Same as <a href="#item1>1</a></li>
</ol>

, . , , . :

<ol>
    <li is="item0">This is the very first item</li>
    <li id="item1">This is a numbered item</li>
    <li id="item2">This is another numbered item</li>
    <li id="item3">Same as <a href="#item1>2</a></li>
</ol>

. . , :

<a href="#item1>1</a>

:

<a href="#item1>2</a>

- ( "1" "2" ). . - HTML , , JavaScript / CSS, .

, , . HTML. Markdown? :

Markdown HTML . , HTML.

Markdown .

, - , - , Markdown/HTML.

+1

, H1.. H6, Markdown , :

# H1
## H2
### H3
#### H4
##### H5
###### H6

- :

###### 1. This is a numbered item
###### 2. This is another numbered item
###### 3. Same as 1

:

<h6 id="1-this-is-a-numbered-item">1. This is a numbered item</h6>
<h6 id="2-this-is-another-numbered-item">2. This is another numbered item</h6>
<h6 id="3-same-as-1">3. Same as 1</h6>
0

All Articles