Code (backticks) as a part of h1 heading? #8294
Replies: 2 comments 6 replies
-
This behaviour does not |
Beta Was this translation helpful? Give feedback.
-
Hmm, I'm surprised @slorber said it "would be fixed" in beta.2—AFAICT it had never worked. The H1 heading is different from the other headings because it's extracted before the Markdown is even properly parsed with MDX—we use a simple regex. This feature was originally implemented by @armano2. The idea is that H1 headings are actually sugar for: ---
title: The `satisfies` Operator
---
Your content Where Markdown obviously doesn't work, since the front matter is plain text. Another reason why it doesn't is because the H1 heading is used in many more places than the title itself. It's used in the browser tab title, in breadcrumb title, pagination, sidebar, etc., where none of them permit any kind of typography. A reasonable behavior is to assume everything within the heading is plain text, else we need to actually do the parsing and strip all the Markdown away, since we have to render plain text for most places anyway. |
Beta Was this translation helpful? Give feedback.
-
I see from #5065 -> https://docusaurus.io/docs/api/docusaurus-config that
`
in headings is meant to work. But in JoshuaKGoldberg/learning-typescript-site#3 I see that when using the backticks inside specifically the top-level heading, it's still plain text:Note that h2 and h3 headings do correctly format backticks into code.
Am I doing something wrong here?
Beta Was this translation helpful? Give feedback.
All reactions