Skip to content

Commit 1501e5b

Browse files
committed
allow (and properly style) code blocks in headings
1 parent b49c510 commit 1501e5b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

apps/svelte.dev/src/routes/docs/[...path]/+layout.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
3232
.page :global(:where(h2, h3) code) {
3333
all: unset;
34+
font-family: var(--sk-font-mono);
3435
}
3536
3637
@media (min-width: 832px) {

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,7 @@ export async function render_content_markdown(
269269
headings[depth - 1] = slugify(raw);
270270
headings.length = depth;
271271
const slug = headings.filter(Boolean).join('-');
272-
return `<h${depth} id="${slug}">${text.replace(
273-
/<\/?code>/g,
274-
''
275-
)}<a href="#${slug}" class="permalink"><span class="visually-hidden">permalink</span></a></h${depth}>`;
272+
return `<h${depth} id="${slug}">${text}<a href="#${slug}" class="permalink"><span class="visually-hidden">permalink</span></a></h${depth}>`;
276273
},
277274
code({ text }) {
278275
return snippets.get(text);

0 commit comments

Comments
 (0)