fix: resolve inline code block rendering issue on Microsoft Edge translation

This commit is contained in:
WellsTsai 2024-12-06 13:59:32 +08:00
parent 839fbd0ecb
commit 392b2844a0

View File

@ -1,5 +1,6 @@
<section class="article-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 }}
{{ $wrappedInlineCodeBlock := printf "<span>${1}</span>" }}
{{ .Content | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | replaceRE "(<code>.*?</code>)" $wrappedInlineCodeBlock | safeHTML }}
</section>