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 <mail@thegeeklab.de>
This commit is contained in:
brett ohland 2022-05-23 16:37:06 -06:00 committed by GitHub
parent f1457b86fa
commit 61ef82104e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 5 deletions

View file

@ -32,3 +32,5 @@ UI
webpack webpack
pre-processor[s]? pre-processor[s]?
propertylist propertylist
gists
spf13

View file

@ -83,13 +83,25 @@ echo "Hello World"
**Example:** **Example:**
<!-- markdownlint-disable -->
<!-- prettier-ignore-start --> <!-- prettier-ignore-start -->
<!-- markdownlint-capture -->
<!-- markdownlint-disable -->
{{< highlight Shell "linenos=table" >}} {{< highlight Shell "linenos=table" >}}
# some code # some code
echo "Hello World" echo "Hello World"
{{< /highlight >}} {{< /highlight >}}
<!-- markdownlint-restore -->
<!-- prettier-ignore-end--> <!-- prettier-ignore-end-->
<!-- markdownlint-enable --> ## 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).
<!-- prettier-ignore -->
```markdown
{{</* gist spf13 7896402 */>}}
```
**Example:**
{{< gist spf13 7896402 >}}

View file

@ -1,6 +1,6 @@
{{ $content := .Content }} {{ $content := .Content }}
{{ $content = $content | replaceRE `<nav id="TableOfContents">\s*<ul>\s*<li>\s*<ul>` `<nav id="TableOfContents"><ul>` | replaceRE `</ul>\s*</li>\s*</ul>\s*</nav>` `</ul></nav>` | safeHTML }} {{ $content = $content | replaceRE `<nav id="TableOfContents">\s*<ul>\s*<li>\s*<ul>` `<nav id="TableOfContents"><ul>` | replaceRE `</ul>\s*</li>\s*</ul>\s*</nav>` `</ul></nav>` | safeHTML }}
{{ $content = $content | replaceRE `(<table>(?:.|\n)+?</table>)` `<div class=table-wrap> ${1} </div>` | safeHTML }} {{ $content = $content | replaceRE `(<table>(?:.|\n)+?</table>)` `<div class="table-wrap"> ${1} </div>` | safeHTML }}
{{ return $content }} {{ return $content }}

View file

@ -131,7 +131,7 @@
} }
} }
table:not(.lntable) { table:not(.lntable):not(.highlight) {
display: table; display: table;
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;