Added captures to images in posts, fixed overflowing mathjax (#508)

* added captures to images in posts, fixed overflowing mathjax

* fix

* phrasing fix
This commit is contained in:
trean
2024-01-08 17:10:07 +01:00
committed by GitHub
parent c355c510b6
commit 1fb0d27c21
4 changed files with 11 additions and 4 deletions
@@ -73,7 +73,12 @@
</div>
</section>
<div class="qb-post__content">
{{ .Content }}
{{ $reAltTitleIn := "<img src=\"([^\"]+)\" alt=\"([^\"]*)\" title=\"([^\"]+)\">" }}
{{ $reAltTitleOut := "<figure><img src=\"$1\" alt=\"$2\" title=\"$3\"><figcaption>$3</figcaption></figure>" }}
{{ $contentWithImgCaptures := .Content | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }}
{{ $wrappedTable := printf "<div class=table-responsive> ${1} </div>" }}
{{ $contentWithImgCaptures | replaceRE "(<table>(?:.|\n)+?</table>)" $wrappedTable | safeHTML }}
</div>
</div>
</div>