pandoc/test/command/3577.md
John MacFarlane 7a9832166e Add text wrapping to HTML output.
Previously the HTML writer was exceptional in not being
sensitive to the `--wrap` option.  With this change `--wrap`
now works for HTML. The default (as with other formats) is
automatic wrapping to 72 columns.

A new internal module, T.P.Writers.Blaze, exports `layoutMarkup`.
This converts a blaze Html structure into a doclayout Doc Text.

In addition, we now add a line break between an `img` tag
and the associated `figcaption`.

Note: Output is never wrapped in `writeHtmlStringForEPUB`.
This accords with previous behavior since previously the HTML
writer was insensitive to `--wrap` settings.  There's no real
need to wrap HTML inside a zipped container.

Note that the contents of script, textarea, and pre tags are
always laid out with the `flush` combinator, so that unwanted
spaces won't be introduced if these occur in an indented context
in a template.

Closes #7764.
2021-12-22 09:45:02 -08:00

858 B

% pandoc -f latex -t html5 --quiet
\begin{figure}[ht]
    \begin{subfigure}{0.45\textwidth}
        \centering
        \includegraphics{img1.jpg}
        \caption{Caption 1}
    \end{subfigure}

    \begin{subfigure}{0.45\textwidth}
        \centering
        \includegraphics{img2.jpg}
        \caption{Caption 2}
    \end{subfigure}
    \caption{Subfigure with Subfloat}
\end{figure}
^D
<figure>
<img src="img1.jpg" alt="Caption 1" />
<figcaption aria-hidden="true">Caption 1</figcaption>
</figure>
<figure>
<img src="img2.jpg" alt="Caption 2" />
<figcaption aria-hidden="true">Caption 2</figcaption>
</figure>
% pandoc -f latex -t html5
\begin{figure}[ht]
    \includegraphics{img1.jpg}
    \caption{Caption 3}
\end{figure}
^D
<figure>
<img src="img1.jpg" alt="Caption 3" />
<figcaption aria-hidden="true">Caption 3</figcaption>
</figure>