Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect html5 figure breaks css #1005

Closed
teepeemm opened this issue Jun 7, 2018 · 1 comment

Comments

@teepeemm
Copy link
Contributor

@teepeemm teepeemm commented Jun 7, 2018

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.)

@dginev dginev added this to the LaTeXML-0.8.4 milestone Jun 7, 2018
@brucemiller

This comment has been minimized.

Copy link
Owner

@brucemiller brucemiller commented Jun 16, 2018

yeah; another one of those situations where you have to fall-back to span-soup. Fixed in the xslt (but note that the figure will end up as a span with class=ltx_figure). Thanks for the report.

@dginev dginev modified the milestones: LaTeXML-0.8.4, LaTeXML-0.8.3 Jul 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.