-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Adding class to markdown header puts class name in URL #2419
Comments
This syntax is used to define a custom ids for the headings, see https://www.markdownguide.org/extended-syntax/#heading-ids for details. So when you use this code:
URL will be like this: http://someurl.com#custom-id However, I think we can add support for this feature in v2. @yangshun agree with this? But in fact, this does not apply to the topic of this issue. @adamstevens87 you just need to use the explicitly appropriate HTML tag to make it possible to style it: <h3 class="class-name"> Title </h3> |
Hi @lex111 - thanks for you answer - I reaslie the title was misleading, but I also tried: GeneralAnd the output URL is: https://dosomeutl.com#span-classfaq-header-general-span I wanted to use the ## notation so the title was added to the sidebar. Is there something I am missing? |
@adamstevens87 I see, then when generating slug we will not consider any HTML, and in the end slug will be clean (just |
Thanks for confirming. |
Example:
### My Great Heading {#custom-id}
Output URL:
http://someurl.com#my-great-heading-custom-id
Expected output URL:
http://someurl.com#my-great-heading
I am adding a custom class to my header to add styling as needed. However, this impacts the URL of the header in an unexpected (and unwanted) way.
I also tried:
### <span class="class-name"> Title </span>
but this output is even worse! :)
The text was updated successfully, but these errors were encountered: