Files
John MacFarlane 60b4011902 DocBook reader: improve handling of literallayout.
This is now only made a CodeBlock when there is a `monospaced`
class.

Otherwise it is made a LineBlock.

Closes #10825.
2025-05-08 11:19:54 -07:00

1.2 KiB

% pandoc -f docbook -t html
<?xml version="1.0" encoding="utf-8"?>
<book xmlns="http://docbook.org/ns/docbook" version="5.0">
  <info><title>Literallayout test</title></info>
  <chapter>
    <info><title>Literallayout without class</title></info>
    <literallayout>First line.
Second line.
  Third line, indented two spaces.</literallayout>
  </chapter>
  <chapter>
    <info><title>Literallayout with normal class</title></info>
    <literallayout class="normal">First line.
Second line.
  Third line, indented two spaces.</literallayout>
  </chapter>
  <chapter>
    <info><title>Literallayout with monospaced</title></info>
    <literallayout class="monospaced">First line.
Second line.
  Third line, indented two spaces.</literallayout>
  </chapter>
</book>
^D
<h1>Literallayout without class</h1>
<div class="line-block">First line.<br />
Second line.<br />
  Third line, indented two spaces.</div>
<h1>Literallayout with normal class</h1>
<div class="line-block">First line.<br />
Second line.<br />
  Third line, indented two spaces.</div>
<h1>Literallayout with monospaced</h1>
<pre><code>First line.
Second line.
  Third line, indented two spaces.</code></pre>