Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/svelte.dev/src/routes/blog/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<article class="top" data-pubdate={top.date}>
<a href="/{top.slug}" title="Read the article »">
<h2>{top.metadata.title}</h2>
<p>{top.metadata.description}</p>
<p>{@html top.metadata.description}</p>
</a>

<Byline post={top} />
Expand Down
2 changes: 1 addition & 1 deletion apps/svelte.dev/src/routes/blog/[slug]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<div class="content">
<article class="post listify text">
<h1>{data.metadata.title}</h1>
<p class="standfirst">{data.metadata.description}</p>
<p class="standfirst">{@html data.metadata.description}</p>

<Byline post={data} />

Expand Down
6 changes: 5 additions & 1 deletion packages/site-kit/src/lib/server/content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ export async function create_index(
}

metadata.title = smart_quotes(metadata.title);
if (metadata.description) metadata.description = smart_quotes(metadata.description);
if (metadata.description)
metadata.description = smart_quotes(metadata.description).replace(
/`(.+?)`/g,
'<code>$1</code>'
);

const sections = Array.from(body.matchAll(/^##\s+(.*)$/gm)).map((match) => {
const title = match[1].replace(/`/g, '').replace(/&lt;/g, '<').replace(/&gt;/g, '>');
Expand Down
4 changes: 2 additions & 2 deletions packages/site-kit/src/lib/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,14 @@ kbd {
}

code {
font-size: var(--sk-font-size-code);
font-size: 0.666em;
position: relative;
border-radius: 0.3em;
white-space: nowrap;
color: var(--sk-text-2);
-webkit-font-smoothing: initial;
padding: 0.4rem;
margin: 0 0.2rem;
top: -0.1rem;
background: var(--sk-back-4);
line-height: 1.7;
}
Expand All @@ -115,6 +114,7 @@ pre code {
background-color: transparent;
padding: 0;
margin: 0;
font-size: var(--sk-font-size-code);
}

::selection {
Expand Down
Loading