commit:     cf0596ca82a42981b24c3562d78e4412377f4b74
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  1 18:46:22 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Oct  1 18:46:22 2025 +0000
URL:        https://gitweb.gentoo.org/proj/pms.git/commit/?id=cf0596ca

Makefile: Yet another tex4ht workaround

HTML output is invalid because longtable captions are misplaced.
For example, xmllint says:

element td: validity error : Element caption is not declared in td list of 
possible children

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index 1850adf..d76bfb8 100644
--- a/Makefile
+++ b/Makefile
@@ -54,6 +54,9 @@ pms.html: $(LATEXFILES) pms.bbl $(COMMITINFO)
          oldsum=$${sum}; sum=$$(cksum $@); \
          test "$${sum}" != "$${oldsum}" || break; \
        done
+       @# fix longtable captions (https://puszcza.gnu.org.ua/bugs/?315)
+       LC_ALL=C sed -Ei '/<table\>[^>]*\<longtable\>/{:x;/<\/tr>/!{N;bx;};'\
+       's,(<table\>[^>]*>)(.*)(<caption\>.*</caption>),\1\3\2,;}' $@
 
 pms.bbl: pms.bib $(LATEXFILES) $(COMMITINFO)
        $(aux-clean)

Reply via email to