Re: Title + section behavior
Posted by
mojavelinux on
Jan 27, 2021; 10:44pm
URL: https://discuss.asciidoctor.org/Title-section-behavior-tp8461p8462.html
This is an undefined scenario in AsciiDoc and therefore the specified behavior is undefined. The processor can do what it thinks is sensible, but a validator should report that the AsciiDoc is invalid. You cannot have a block title on a section title and expect it to work.
Best Regards,
-Dan
On Wed, Jan 27, 2021 at 3:34 PM Sylvain Leroux [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
Hi,
Could you give me some clarifications about the way the following AsciiDoc document is parsed:
.My title
== My section
Some content
By looking at the docbook output, it seems the title is attached to the first paragraph of the section:
<?xml version="1.0" encoding="UTF-8"?>
<?asciidoc-toc?>
<?asciidoc-numbered?>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:lang="en">
<info>
<title>My section</title>
<date>2021-01-27</date>
</info>
<section xml:id="_my_section">
<title>My section</title>
<formalpara>
<title>My title</title>
<para>Some content</para>
</formalpara>
</section>
</article>
Is this the expected behavior? Or is the initial document malformed--and thus the result should be considered as undefined?
--