fix: markdown and katex rendering problem

This commit is contained in:
zayn7lie 2024-04-09 22:31:24 -04:00 committed by GitHub
parent 00357fcd51
commit ec960de5ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,5 +1,8 @@
<section class="article-content"> <section class="article-content">
<!-- Refer to https://discourse.gohugo.io/t/responsive-tables-in-markdown/10639/5 --> <!-- Refer to https://discourse.gohugo.io/t/responsive-tables-in-markdown/10639/5 -->
{{ $wrappedTable := printf "<div class=\"table-wrapper\">${1}</div>" }} {{ $wrappedTable := printf "<div class=\"table-wrapper\">${1}</div>" }}
{{ if or .Params.math .Site.Params.article.math }}
{{ partial "article/components/mdtexbug" . }}
{{ end }}
{{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }} {{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }}
</section> </section>