From 9ed6d09bf8d4b7503a5da08518b77f723dbaf754 Mon Sep 17 00:00:00 2001 From: Puru Vijay Date: Thu, 30 Mar 2023 23:52:40 +0530 Subject: [PATCH] Minor fixes --- .../docs/03-template-syntax/06-special-elements.md | 14 -------------- sites/svelte.dev/src/lib/server/docs/get-docs.js | 8 +++++++- .../src/routes/docs/[slug]/OnThisPage.svelte | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/site/content/docs/03-template-syntax/06-special-elements.md b/site/content/docs/03-template-syntax/06-special-elements.md index 8f78743b23..3920ac6f84 100644 --- a/site/content/docs/03-template-syntax/06-special-elements.md +++ b/site/content/docs/03-template-syntax/06-special-elements.md @@ -43,8 +43,6 @@ Note: If you want to render regular `` element, You can use ` ---- - Named slots allow consumers to target specific areas. They can also have fallback content. ```svelte @@ -85,8 +83,6 @@ In order to place content in a slot without using a wrapper element, you can use ### $$slots ---- - `$$slots` is an object whose keys are the names of the slots passed into the component by the parent. If the parent does not pass in a slot with a particular name, that name will not be present in `$$slots`. This allows components to render a slot (and other elements, like wrappers for styling) only if the parent provides it. Note that explicitly passing in an empty named slot will add that slot's name to `$$slots`. For example, if a parent passes `
` to a child component, `$$slots.title` will be truthy within the child. @@ -111,8 +107,6 @@ Note that explicitly passing in an empty named slot will add that slot's name to ### ---- - Slots can be rendered zero or more times and can pass values _back_ to the parent using props. The parent exposes the values to the slot template using the `let:` directive. The usual shorthand rules apply — `let:item` is equivalent to `let:item={item}`, and `` is equivalent to ``. @@ -133,8 +127,6 @@ The usual shorthand rules apply — `let:item` is equivalent to `let:item={item} ``` ---- - Named slots can also expose values. The `let:` directive goes on the element with the `slot` attribute. ```svelte @@ -158,8 +150,6 @@ Named slots can also expose values. The `let:` directive goes on the element wit ## `` ---- - The `` element allows a component to include itself, recursively. It cannot appear at the top level of your markup; it must be inside an if or each block or passed to a component's slot to prevent an infinite loop. @@ -183,8 +173,6 @@ It cannot appear at the top level of your markup; it must be inside an if or eac ``` ---- - The `` element renders a component dynamically, using the component constructor specified as the `this` property. When the property changes, the component is destroyed and recreated. If `this` is falsy, no component is rendered. @@ -199,8 +187,6 @@ If `this` is falsy, no component is rendered. ``` ---- - The `` element lets you render an element of a dynamically specified type. This is useful for example when displaying rich text content from a CMS. Any properties and event listeners present will be applied to the element. The only supported binding is `bind:this`, since the element type-specific bindings that Svelte does at build time (e.g. `bind:value` for input elements) do not work with a dynamic tag type. diff --git a/sites/svelte.dev/src/lib/server/docs/get-docs.js b/sites/svelte.dev/src/lib/server/docs/get-docs.js index ad1742f11c..b104550b17 100644 --- a/sites/svelte.dev/src/lib/server/docs/get-docs.js +++ b/sites/svelte.dev/src/lib/server/docs/get-docs.js @@ -78,7 +78,13 @@ function get_sections(markdown) { while ((match = headingRegex.exec(markdown)) !== null) { secondLevelHeadings.push({ - title: removeMarkdown(transform(match[1], { paragraph: (txt) => txt })), + title: removeMarkdown( + transform(match[1], { paragraph: (txt) => txt }) + .replace(/<\/?code>/g, '') + .replace(/"/g, '"') + .replace(/</g, '<') + .replace(/>/g, '>') + ), slug: normalizeSlugify(match[1]) }); } diff --git a/sites/svelte.dev/src/routes/docs/[slug]/OnThisPage.svelte b/sites/svelte.dev/src/routes/docs/[slug]/OnThisPage.svelte index 7103cee76b..584fbab8e2 100644 --- a/sites/svelte.dev/src/routes/docs/[slug]/OnThisPage.svelte +++ b/sites/svelte.dev/src/routes/docs/[slug]/OnThisPage.svelte @@ -89,7 +89,7 @@