Continuing my adventures with the caption package, the following tex
\documentclass{article}
\usepackage{caption}
\begin{document}
\begin{center}
\marginpar{\captionsetup{type=figure}\caption{good caption}}
\end{center}
\begin{center}
text
\marginpar{\captionsetup{type=figure}\caption{bad caption}}
\end{center}
\end{document}
produces html I would expect, but that turns out to be incorrect. A simplified version of that html is the following:
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>Test</title>
<style type="text/css">
span figure { border: 1px solid green; }
body > figure { border: 1px solid red; }
</style>
</head>
<body>
<span><figure>good content</figure></span>
<p><span><figure>bad content</figure></span></p>
</body>
</html>
The problem is that it seems figure tags aren't allowed in p tags (a severely out of date source). Therefore, Chrome and Firefox (at least) treat the second figure as if it were
<p><span></span></p>
<figure>bad content</figure>
<p></p>
This means that the default css for margin notes no longer applies. (The W3C validator also complains about the first span > figure, but Chrome and Firefox at least render it correctly.)
Continuing my adventures with the caption package, the following tex
produces html I would expect, but that turns out to be incorrect. A simplified version of that html is the following:
The problem is that it seems figure tags aren't allowed in p tags (a severely out of date source). Therefore, Chrome and Firefox (at least) treat the second figure as if it were
This means that the default css for margin notes no longer applies. (The W3C validator also complains about the first span > figure, but Chrome and Firefox at least render it correctly.)