Skip to content
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

Spec emits code with redundant "id" from headers and [Link](@) #625

Closed
steve-h opened this issue Dec 14, 2019 · 6 comments · Fixed by #626
Closed

Spec emits code with redundant "id" from headers and [Link](@) #625

steve-h opened this issue Dec 14, 2019 · 6 comments · Fixed by #626

Comments

@steve-h
Copy link

steve-h commented Dec 14, 2019

Maybe a naive assumption that the CommonMark spec would be written in CommonMark?

I cannot easily find the syntax [link ref](@)

The specific example is in the section trying to forward link to the id="container-blocks" but the code to do so seems to emit the id that ends up dominating in the DOM; so the link does not work.

I do not know how to fix since I cannot find the @ in the URL definition. At least the spec.commonmark.org should work??

<h2 id="container-blocks-and-leaf-blocks" href="#container-blocks-and-leaf-blocks" class="definition">
<span class="number">3.2</span>Container blocks and leaf blocks
</h2>
<p>We can divide blocks into two types:
<a id="container-blocks" href="#container-blocks" class="definition">container blocks</a>,
which can contain other blocks, and <a id="leaf-blocks" href="#leaf-blocks" class="definition">leaf blocks</a>,
which cannot.</p>
@JohelEGP
Copy link
Contributor

See https://spec.commonmark.org/0.29/#about-this-document:

This document is generated from a text file, spec.txt, written in Markdown with a small extension for the side-by-side tests.

The [link ref](@) seems to also be part of this extension, as it isn't CommonMark.

@steve-h
Copy link
Author

steve-h commented Dec 14, 2019

OK. It still is generating improper HTML for headers; href not allowed in <h1>

<h1 id="introduction" href="#introduction" class="definition">
<span class="number">1</span>Introduction
</h1>

Just surprised that a site about html generation generates unverified spec pages. Thought that I should at least open an issue. I am happy if it is resolved by mentioning that the Table of Contents produced by the extension deliberately is not working.

@Crissov
Copy link
Contributor

Crissov commented Dec 15, 2019

/tools/make_spec.lua line 171 probably copies line 140 too carelessly. Headings should indeed have no href attribute.

@steve-h
Copy link
Author

steve-h commented Dec 15, 2019

I am actively using the CommonMark spec and cMark to help another open source markdown parser. I am just reporting "user" troubles I am encountering. It is a great resource and I am not needing any fixes. The next intense user might benefit. Thanks. I won't close now as the multiple id generation on the page still exists in the publishing stream to spec.commonmark.org

@steve-h
Copy link
Author

steve-h commented Dec 15, 2019

I also just realized that the order that the test examples appear in the GitHub spec.txt file are not the same order as seen on the spec.commonmark.org page. This confused me since I was using the "Example ##" style and the did not match the online example numbers. This can lead to confusion when discussing conformance to tests. A proper naming of the test might be better or just keeping the order in the definitive source file spec.txt

@jgm
Copy link
Member

jgm commented Dec 16, 2019

The order should be the same, but note that the spec on the website is the last released version, and the spec.txt in the master branch of the repository may contain changes that were not in the last release.

@jgm jgm closed this as completed in #626 Dec 16, 2019
jgm pushed a commit that referenced this issue Dec 16, 2019
Removes extraneous href attribute on headings.

fixes #625
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants