Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhixuan <59254886+zhixuan2333@users.noreply.github.com>2022-01-20 14:09:25 +0300
committerGitHub <noreply@github.com>2022-01-20 14:09:25 +0300
commit0af9d23e4989ed7ada10e6990802ccd9a28d8797 (patch)
treea7469dff7c7a1ecf4b0130b7edc43adc986f5bf6 /layouts
parent3b98d3ba051f64c52ba6a21125b2016a61e6edc3 (diff)
feat(article): add scroll for table (#428)
* feat: table can't scroll & delete scrollbar style for Chromium * Undo some line breaks * Add a table with overflow to exampleSite
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/article/components/content.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/partials/article/components/content.html b/layouts/partials/article/components/content.html
index fc0f8f6..61e536c 100644
--- a/layouts/partials/article/components/content.html
+++ b/layouts/partials/article/components/content.html
@@ -1,3 +1,5 @@
<section class="article-content">
- {{ .Content }}
+ <!-- Refer to https://discourse.gohugo.io/t/responsive-tables-in-markdown/10639/5 -->
+ {{ $wrappedTable := printf "<div class=\"table-wrapper\">${1}</div>" }}
+ {{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }}
</section>