use table render hook instead of refactor

This commit is contained in:
geekifan
2025-04-28 21:55:12 +08:00
parent 13dc3b9771
commit 483debe717
2 changed files with 39 additions and 8 deletions

View File

@ -1,13 +1,5 @@
{{ $content := .Content }}
<!-- Handle tables -->
{{ if findRE `<table` $content }}
{{ $content = replace $content `<table` `<div class="table-wrapper"><table` }}
{{ $content = replace $content `</table>` `</table></div>` }}
{{ $content = replace $content `<code><div class="table-wrapper">` `<code>` }}
{{ $content = replace $content `</table></div></code>` `</table></code>` }}
{{ end }}
<!-- Change checkbox icons -->
{{ if findRE `<input.*type="checkbox"` $content }}
<!-- first replace the li with task-list-item class -->