From 61ef82104ea45f4e568cbc7301af171b8c18351e Mon Sep 17 00:00:00 2001 From: brett ohland Date: Mon, 23 May 2022 16:37:06 -0600 Subject: [PATCH] fix: remove table formatting from github gists (#416) * fix: fix CSS issue with gist embeds * Addressing PR comments * remove newline * simplify selector and add example * fix spellcheck * fix markdownlint Co-authored-by: Robert Kaussow --- .dictionary | 2 ++ exampleSite/content/en/features/code-blocks.md | 18 +++++++++++++++--- layouts/partials/utils/content.html | 2 +- src/sass/_markdown.scss | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.dictionary b/.dictionary index 4ee8422..a13fe2c 100644 --- a/.dictionary +++ b/.dictionary @@ -32,3 +32,5 @@ UI webpack pre-processor[s]? propertylist +gists +spf13 diff --git a/exampleSite/content/en/features/code-blocks.md b/exampleSite/content/en/features/code-blocks.md index e13aa1a..5964122 100644 --- a/exampleSite/content/en/features/code-blocks.md +++ b/exampleSite/content/en/features/code-blocks.md @@ -83,13 +83,25 @@ echo "Hello World" **Example:** - - + + {{< highlight Shell "linenos=table" >}} # some code echo "Hello World" {{< /highlight >}} + - +## Gist Shortcode + +The Gist shortcode is a built-in Hugo shortcode to load GitHub gists. For details usage information please check the Hugo [documentation](https://gohugo.io/content-management/shortcodes/#gist). + + +```markdown +{{}} +``` + +**Example:** + +{{< gist spf13 7896402 >}} diff --git a/layouts/partials/utils/content.html b/layouts/partials/utils/content.html index a888b66..c2085a9 100644 --- a/layouts/partials/utils/content.html +++ b/layouts/partials/utils/content.html @@ -1,6 +1,6 @@ {{ $content := .Content }} {{ $content = $content | replaceRE `` `` | safeHTML }} -{{ $content = $content | replaceRE `((?:.|\n)+?
)` `
${1}
` | safeHTML }} +{{ $content = $content | replaceRE `((?:.|\n)+?
)` `
${1}
` | safeHTML }} {{ return $content }} diff --git a/src/sass/_markdown.scss b/src/sass/_markdown.scss index c568890..6ac88d6 100644 --- a/src/sass/_markdown.scss +++ b/src/sass/_markdown.scss @@ -131,7 +131,7 @@ } } - table:not(.lntable) { + table:not(.lntable):not(.highlight) { display: table; border-spacing: 0; border-collapse: collapse;