diff --git a/apps/svelte.dev/src/routes/content.json/+server.ts b/apps/svelte.dev/src/routes/content.json/+server.ts
index 06a7159bc1..e2d7e9b2cb 100644
--- a/apps/svelte.dev/src/routes/content.json/+server.ts
+++ b/apps/svelte.dev/src/routes/content.json/+server.ts
@@ -97,7 +97,14 @@ async function plaintext(markdown: string) {
return (
await markedTransform(markdown, {
- code: ({ text }) => text.split('// ---cut---\n').pop() || 'ERROR: ---cut--- not found',
+ code: ({ text }) => {
+ const raw = text.split('// ---cut---\n').pop() ?? '';
+
+ return raw
+ .replace(/^\/\/ @noErrors.*$/gm, ' ')
+ .replace(/^\/\/ @errors.+$/gm, ' ')
+ .replace(/^\/\/\/ file:.+$/gm, ' ');
+ },
blockquote: block,
html: () => '\n',
heading: ({ text }) => `${text}\n`,
@@ -105,7 +112,9 @@ async function plaintext(markdown: string) {
list: block,
listitem: block,
checkbox: block,
- paragraph: ({ text }) => `${text}\n\n`,
+ paragraph({ tokens }) {
+ return this.parser!.parseInline(tokens);
+ },
table: block,
tablerow: block,
tablecell: ({ text }) => {
diff --git a/packages/site-kit/src/lib/search/SearchBox.svelte b/packages/site-kit/src/lib/search/SearchBox.svelte
index 54dfeb23de..4f1afb3ae1 100644
--- a/packages/site-kit/src/lib/search/SearchBox.svelte
+++ b/packages/site-kit/src/lib/search/SearchBox.svelte
@@ -160,24 +160,26 @@ It appears when the user clicks on the `Search` component or presses the corresp
use:trap
>
{:else}
-
+
{#if idle}
{@render idle(recent_searches.length)}
{:else}
{recent_searches.length ? 'Recent searches' : 'No recent searches'}
{/if}
-
+
+
{#if recent_searches.length}
-
+
{#each recent_searches as search}
- -
+
-
navigate(search.href)} href={search.href}>
{search.breadcrumbs.at(-1)}
@@ -279,7 +282,7 @@ It appears when the user clicks on the `Search` component or presses the corresp
.search-box {
--padding: 1rem;
--background: var(--sk-back-2);
- background: var(--background);
+ /* background: var(--background); */
position: relative;
height: calc(100% - 2rem);
width: calc(100vw - 2rem);
@@ -360,9 +363,57 @@ It appears when the user clicks on the `Search` component or presses the corresp
.results-container {
border-radius: 0 0 var(--sk-border-radius) var(--sk-border-radius);
pointer-events: all;
+ background: var(--background);
+
+ li {
+ position: relative;
+
+ a {
+ color: var(--sk-text-2);
+ display: block;
+ text-decoration: none;
+ padding: 0.5rem calc(4rem + var(--padding)) 0.5rem var(--padding);
+
+ &:hover {
+ background: rgba(0, 0, 0, 0.05);
+ }
+
+ &:focus {
+ outline-offset: -3px;
+ }
+ }
+
+ button[aria-label='Delete'] {
+ position: absolute;
+ top: 0;
+ right: 0;
+ width: 5rem;
+ height: 100%;
+ color: var(--sk-text-2);
+ opacity: 0.1;
+
+ &:hover {
+ opacity: 1;
+ outline: none;
+ }
+
+ &:focus-visible {
+ opacity: 1;
+ outline-offset: -3px;
+ }
+ }
+ }
+
+ .recent {
+ a {
+ font-size: var(--sk-font-size-ui-medium);
+ }
+ }
}
.info {
+ display: block;
+ background: var(--background);
padding: var(--padding);
font-family: var(--sk-font-ui);
font-size: var(--sk-font-size-ui-medium);
@@ -370,49 +421,9 @@ It appears when the user clicks on the `Search` component or presses the corresp
font-weight: normal;
text-transform: uppercase;
pointer-events: all;
- }
-
- .info.empty {
- border-radius: 0 0 var(--sk-border-radius) var(--sk-border-radius);
- }
-
- a {
- color: var(--sk-text-2);
- display: block;
- text-decoration: none;
- line-height: 1;
- padding: 1rem calc(4rem + var(--padding)) 1rem var(--padding);
-
- &:hover {
- background: rgba(0, 0, 0, 0.05);
- }
-
- &:focus {
- outline-offset: -3px;
- }
- }
-
- li {
- position: relative;
- }
- button[aria-label='Delete'] {
- position: absolute;
- top: 0;
- right: 0;
- width: 5rem;
- height: 100%;
- color: var(--sk-text-2);
- opacity: 0.1;
-
- &:hover {
- opacity: 1;
- outline: none;
- }
-
- &:focus-visible {
- opacity: 1;
- outline-offset: -3px;
+ &.empty {
+ border-radius: 0 0 var(--sk-border-radius) var(--sk-border-radius);
}
}
diff --git a/packages/site-kit/src/lib/search/SearchResultList.svelte b/packages/site-kit/src/lib/search/SearchResultList.svelte
index 1fcc98445c..64d4b8658e 100644
--- a/packages/site-kit/src/lib/search/SearchResultList.svelte
+++ b/packages/site-kit/src/lib/search/SearchResultList.svelte
@@ -20,8 +20,8 @@
}
const prefix =
- index > 20
- ? `${escape(content.slice(index - 15, index))}`
+ index > 40 && content.length > 70
+ ? `${escape(content.slice(index - 35, index))}`
: `${escape(content.slice(0, index))}`;
const suffix = escape(
content.slice(
@@ -73,7 +73,7 @@
}
details {
- padding: 0.5rem 0;
+ padding: calc(0.5 * var(--padding)) 0;
summary {
position: sticky;
@@ -82,7 +82,7 @@
display: block;
color: var(--sk-text-4);
text-transform: uppercase;
- padding: 0.5rem var(--padding);
+ padding: calc(0.5 * var(--padding)) var(--padding);
font-size: var(--sk-font-size-ui-medium);
z-index: 2;
user-select: none;
diff --git a/packages/site-kit/src/lib/search/SearchResults.svelte b/packages/site-kit/src/lib/search/SearchResults.svelte
index e1b9791f1e..1955134367 100644
--- a/packages/site-kit/src/lib/search/SearchResults.svelte
+++ b/packages/site-kit/src/lib/search/SearchResults.svelte
@@ -31,7 +31,8 @@ Renders a list of search results