-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustdoc unexpectedly formatted leading numeral as a list #92005
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I imagine this is probably an upstream bug with pulldown-cmark. cc @marcusklaas |
I wonder if the leading 2 is actually in the HTML but is being cut off by some CSS rules. Can you post the relevant snippet of HTML for both rustdoc versions? |
With <div class="docblock"><ol>
<li>One
<ol>
<li>Two</li>
</ol>
</li>
</ol>
<p>This record means: user 123 has the “admin” role on the “project” with id</p>
<ol start="234">
<li>(Note.)</li>
</ol>
</div> With <div class="docblock"><ol>
<li>One
<ol>
<li>Two</li>
</ol>
</li>
</ol>
<p>This record means: user 123 has the “admin” role on the “project” with id</p>
<ol start="234">
<li>(Note.)</li>
</ol>
</div> In case it's useful, this is very easily reproduced -- e.g., with https://github.com/davepacheco/rustdoc-test. |
Thanks! So, indeed, it seems the |
Ooh, this is an interesting one. While this is certainly surprising, I'm not 100% confident this is a bug in pulldown. I played around in dingus, the CommonMark reference implementation, and found that it also produced a list for this snippet: a
1. d However, if the final line is changed to I will have to check the spec, because I can't remember there being different rules for lists that do not start at one. |
It turns out there is a special rule for starting lists with the number one. From the spec:
And then there follow two tests that test exactly this distinction. Pulldown passes those tests, so I'm confused why it also produces a list for 1. a
1. a
a
2. a I will create an issue on the pulldown repo and investigate further... |
Thanks for fixing it! |
@marcusklaas what is the timeline for the next pulldown release? |
Very soon! |
Pulldown version 0.9.0 has just been released! |
Thanks! |
This will be fixed once #92252 has landed, which will happen shortly. Closing this issue. EDIT: The PR has landed now. |
I have a feeling I'm doing something wrong here so I apologize in advance if this is just noise. But the behavior I'm seeing seems surprising.
I tried this code:
and I built this with
cargo doc
.I expected to see this sentence together in one paragraph: "This record means: user 123 has the "admin" role on the "project" with id 234. (Note.)"
Instead, this happened:
Looking at the HTML, it's interpreted the leading "234." as a numbered list. Thinking this was some Markdown error, I tried it in the dingus but it does what I expected.
Meta
On
cargo 1.59.0-nightly (a359ce160 2021-12-14)
, I see almost the same behavior, but the "2" in 234 gets eaten:The text was updated successfully, but these errors were encountered: