Skip to content

Custom attributes not working on headings #1304

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

Closed
hacknug opened this issue Jun 28, 2022 · 0 comments · Fixed by #1307
Closed

Custom attributes not working on headings #1304

hacknug opened this issue Jun 28, 2022 · 0 comments · Fixed by #1307
Labels
bug Something isn't working

Comments

@hacknug
Copy link

hacknug commented Jun 28, 2022

Environment

Reproduction

Open the playground and paste the following code:

# Doesn't [work]{.font-bold}

# [This one either]{.font-bold}

Does [work]{.font-bold}

[This one too]{.font-bold}

Describe the bug

You'll see how the AST shows the paragraphs getting their props but the headings get nothing.

Additional context

This is likely something related to rehype-slug. It's probably passing things down but the plugin ignores them.

I'd expect those attributes to be passed down to my inner span since I understand why this could be something not supported in projects using rehype-slug.

Even when disabling rehype-slug via config, I'm seeing links on those headings. The only difference is the headings don't get an id assigned and a warning shows in my console:

[Vue warn]: Missing required prop: "id"

This wasn't as easy to get to as I would have liked since the docs stated I could disable a plugin using the following config but v2.0.1 had no support for that syntax.

  content: {
    markdown: {
      rehypePlugins: {
        'rehype-slug': false
      },
    },
  },

Might be a good idea to keep the versioned docs and edge in different subdomains/dirs. It's okay though since we all understand the tremendous work you're putting into this just to give it away for free 💖

Let me know how I can help with this 👍

Logs

No response

@farnabaz farnabaz added the bug Something isn't working label Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants