diff --git a/data/secret-scanning.yml b/data/secret-scanning.yml index 9b63e3b851ea..00b9a434e76c 100644 --- a/data/secret-scanning.yml +++ b/data/secret-scanning.yml @@ -824,7 +824,7 @@ isPublic: true isPrivateWithGhas: true hasPushProtection: true - hasValidityCheck: false + hasValidityCheck: '{% ifversion fpt or ghes %}false{% else %}true{% endif %}' - provider: 'Duffel' supportedSecret: 'Duffel Live Access Token' diff --git a/src/content-render/liquid/tool.js b/src/content-render/liquid/tool.js index 5908dbc8b21d..7a7b47dd8965 100644 --- a/src/content-render/liquid/tool.js +++ b/src/content-render/liquid/tool.js @@ -3,7 +3,45 @@ import { allPlatforms } from '#src/tools/lib/all-platforms.js' export const tags = Object.keys(allTools).concat(allPlatforms).concat(['rowheaders']) -const template = '
{{ output }}
' +// The trailing newline is important. Without it, the line immediately after +// the `` will be considered part of the previous block, which means the Markdown following the `` will not be rendered to HTML correctly. For example: +// +//
Here's some stuff
+// And *here* us also some stuff. +// +// Another **sentence** here. +// +// Will yield: +// +//
Here's some stuff
+// And *here* us also some stuff. +// +//

Another sentence here.

+// +// when rendering this template with unified. +// If you instead inject an extra newline after the ``, you +// go from: +// +//
Here's some stuff
+// +// And *here* us also some stuff. +// +// Another **sentence** here. +// +// which yields: +// +//
Here's some stuff
+// +//

And here us also some stuff.

+// +//

Another sentence here.

+// +// The Tool Liquid tags are a little bit fragile because we hope and assume +// that the author of the Liquid+Markdown *don't* do this: +// +// {% vscode %}Bla bla.{% endvscode %}Next stuff here... +// +const template = '
{{ output }}
\n' export const Tool = { type: 'block', diff --git a/src/fixtures/fixtures/content/get-started/liquid/tool-platform-switcher.md b/src/fixtures/fixtures/content/get-started/liquid/tool-platform-switcher.md index 3d3c89288e7d..81b11eb2f508 100644 --- a/src/fixtures/fixtures/content/get-started/liquid/tool-platform-switcher.md +++ b/src/fixtures/fixtures/content/get-started/liquid/tool-platform-switcher.md @@ -78,3 +78,11 @@ Bla bla `linux` specific content. {% endlinux %} + +## Misc testing + +{% linux %} +It's important to test that immediately after the end tag, the Markdown +there renders to HTML. +{% endlinux %} +On *this* line is `Markdown` too. diff --git a/src/fixtures/tests/liquid.js b/src/fixtures/tests/liquid.js index 49b7a8b6a80c..63e2c60dcb09 100644 --- a/src/fixtures/tests/liquid.js +++ b/src/fixtures/tests/liquid.js @@ -224,6 +224,17 @@ describe('misc Liquid', () => { expect(texts[0]).toBe(url) expect(texts[1]).toBe('Pricing') }) + + test('page with tool Liquid tag followed by Markdown', async () => { + // This test tests Markdown being correctly rendered when the + // Markdown directly follows a tool tag like `{% linux %}...{% endlinux %}`. + // The next line immediately after the `{% endlinux %}` should not + // leave the Markdown unrendered + const $ = await getDOM('/get-started/liquid/tool-platform-switcher') + const innerHTML = $('#article-contents').html() + expect(innerHTML).not.toMatch('On *this* line is `Markdown` too.') + expect(innerHTML).toMatch('

On this line is Markdown too.

') + }) }) describe('data tag', () => { diff --git a/src/frame/components/page-header/Header.tsx b/src/frame/components/page-header/Header.tsx index f9c46ad88f22..2986c8c0358b 100644 --- a/src/frame/components/page-header/Header.tsx +++ b/src/frame/components/page-header/Header.tsx @@ -146,251 +146,246 @@ export const Header = () => { } return ( - <> -
+ {error !== '404' && } +
- {error !== '404' && } -
-
- + + )} + + ) } diff --git a/src/landings/components/SidebarProduct.tsx b/src/landings/components/SidebarProduct.tsx index 2e4d14977a04..ec6d6cd1088f 100644 --- a/src/landings/components/SidebarProduct.tsx +++ b/src/landings/components/SidebarProduct.tsx @@ -49,23 +49,21 @@ export const SidebarProduct = () => { nonAutomatedRestPaths.every((item: string) => !page.href.includes(item)), ) return ( - <> -
- - {conceptualPages.map((childPage) => ( - - ))} - - -
- - - {restPages.map((category) => ( - - ))} - -
- +
+ + {conceptualPages.map((childPage) => ( + + ))} + + +
+ + + {restPages.map((category) => ( + + ))} + +
) }