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

bug: markdown anchor links for a header with html #22728

Closed
muescha opened this issue Apr 1, 2020 · 5 comments
Closed

bug: markdown anchor links for a header with html #22728

muescha opened this issue Apr 1, 2020 · 5 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@muescha
Copy link
Contributor

muescha commented Apr 1, 2020

Description

when creating a header with html

  • if there is an anchor tag then this should be used
  • or not use the text excerpt from the additional html

Steps to reproduce

this markdown:

**In this post:**
- [About the project](#about)
- [How it all began](#beginnings)
- [Assembling a team](#team)
- [Building a prototype](#prototype)
- [Get Involved](#help)

### About the project <a name="about"></a>

Expected result

  • a anchor link with about-the-project

Actual result

current status on https://www.gatsbyjs.org/blog/2020-03-26-service-relief-project/

  • the anchor links in the TOC are not working (to #about)
  • a anchor link is created with about-the-project-a-nameabouta
<h3 id="about-the-project-a-nameabouta" style="position:relative" class="css-0">
  <a aria-label="about the project a nameabouta permalink" class="anchor before css-0" href="#about-the-project-a-nameabouta">
    <svg aria-hidden="true" focusable="false" height="16" version="1.1" viewBox="0 0 16 16" width="16">
      <path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
    </svg>
  </a>
  About the project <a name="about" class="css-0"></a>
</h3>

Related Issues

@muescha muescha added the type: bug An issue or pull request relating to a bug in Gatsby label Apr 1, 2020
@pieh
Copy link
Contributor

pieh commented Apr 2, 2020

This is likely related to autolink-headers scroll updates (it uses id only and not name)

Per http://w3c.github.io/html-reference/a.html#a-constraints

The name attribute on the a element is obsolete. Consider putting an id attribute on the nearest container instead.

So we probably won't be fixing the plugin to handle name and instead will need to adjust blog post content - likely to just drop those custom <a> tags with names and use generated ids in table of content?

@muescha
Copy link
Contributor Author

muescha commented Apr 2, 2020

ok - thats why i was waiting for a decision how to fix this blog post :)

@muescha
Copy link
Contributor Author

muescha commented Apr 7, 2020

fixed in:

@github-actions
Copy link

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Apr 28, 2020
@muescha
Copy link
Contributor Author

muescha commented Apr 28, 2020

=> i close the issue

@muescha muescha closed this as completed Apr 28, 2020
@muescha muescha added topic: blogpost and removed stale? Issue that may be closed soon due to the original author not responding any more. labels Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

2 participants