Title + section behavior

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Title + section behavior

Sylvain Leroux
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?
my asciidoctor-based website: https://yesik.it
Reply | Threaded
Open this post in threaded view
|

Re: Title + section behavior

mojavelinux
Administrator
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?
my asciidoctor-based website: https://yesik.it



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Title-section-behavior-tp8461.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Title + section behavior

Sylvain Leroux
Great. That's what I thought.
Thank you,  Dan.
my asciidoctor-based website: https://yesik.it