7a9832166e
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.
2.2 KiB
2.2 KiB
% pandoc -t html
## Example
1. One
2. Two `-->something<!--`
3. Three
~~~html
--><!--<script>alert('Escaped!')</script>
~~~
~~~html
Something
~~~
^D
<h2 id="example">Example</h2>
<ol type="1">
<li>One</li>
<li>Two <code>-->something<!--</code></li>
<li>Three</li>
</ol>
<div class="sourceCode" id="cb1"><pre class="sourceCode
html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>--><span class="co"><!--<script>alert('Escaped!')</script></span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode
html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Something</span></code></pre></div>
% pandoc -t html
## Example 2
- `-->something<!--`
- `-->something<!--`
- bye `-->something else<!--`
~~~html
--><!--<script>alert('Escaped!')</script>
~~~
~~~html
Something
~~~
^D
<h2 id="example-2">Example 2</h2>
<ul>
<li><code>-->something<!--</code></li>
<li><code>-->something<!--</code></li>
<li>bye <code>-->something else<!--</code></li>
</ul>
<div class="sourceCode" id="cb1"><pre class="sourceCode
html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>--><span class="co"><!--<script>alert('Escaped!')</script></span></span></code></pre></div>
<div class="sourceCode" id="cb2"><pre class="sourceCode
html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Something</span></code></pre></div>
% pandoc -t html
## Example 3
1. `-->one<!--`
5. bye `-->two <!--`
3. ` three, not in block
1. four, not in block `
2. five
5. six
6. seven `
- separate unordered list `
42. forty-two, separate ordered list
^D
<h2 id="example-3">Example 3</h2>
<ol type="1">
<li><code>-->one<!--</code></li>
<li>bye <code>-->two <!--</code></li>
<li>` three, not in block</li>
<li>four, not in block `</li>
<li>five</li>
<li>six</li>
<li>seven `</li>
</ol>
<ul>
<li>separate unordered list `</li>
</ul>
<ol start="42" type="1">
<li>forty-two, separate ordered list</li>
</ol>