On 11 September 2014 00:31, Stéphane Gourichon
<[email protected]> wrote:
> Le 10/09/2014 13:05, Lex Trotman a écrit :
>
> On 10 September 2014 08:43, Lex Trotman <[email protected]> wrote:
>
> On 10 September 2014 08:01, Ondra Žižka <[email protected]> wrote:
>
> Hi, could the <p> be removed from <li>? <li> is a block element and does not
> need extra <p>. If something, why not put a neutral <div> in it? Thanks.
>
> No, but you can use a custom xhtml11.conf containing only the relevant
> construct to customise the output.  List are slightly complicated, you
> will need to read the user guide.
>
> To expand further on why not:
>
> 1. there can be more than one paragraph inside a list item, so the <p>
> is needed then.  For consistency and so styling is easier and not
> repeated, <p> is output for single paragraphs as well.
>
> 2. changing the elements that are output will mean that user CSS may
> break since it would be common to style paragraphs inside list items
> as I outlined in a previous post.  A change of elements means this CSS
> would no longer apply, and the default paragraph style would no longer
> apply to content inside list items.
>
> Cheers
> Lex
>
>
> Thanks Lex for this important clarification.
>
> Multi-paragraph list items are tricky to get right (if possible at all) in
> many markup languages.
>
> This is shown in 17.7. List Item Continuation: instead of a blank line, put
> a line with a single plus sign.
>
> The example there generates the following code the first list item:
>
> <p>
> List item one.
> </p>
> <div class="paragraph"><p>List item one continued with a second paragraph
> followed by an
> Indented block.</p></div>
> <div class="literalblock">
> <div class="content">
> <pre><code>$ ls *.sh
> $ mv *.sh ~/tmp</code></pre>
> </div></div>
> <div class="paragraph"><p>List item continued with a third
> paragraph.</p></div>
>
>
> I'm surprised to see that the first is plain "<p>" but also some "<p>"
> surrounded by "<div class="paragraph">".

Hi Stéphane,

The `div.paragraph` is the normal markup for paragraphs in Asciidoc,
but it isn't actually used in the Asciidoc CSS which is probably why
the omission on the list item is normally not noticed.

The reason that it does not appear on the first paragraph in the list
item is that the first item is marked up by the list tags markup, and
the subsequent blocks by the normal paragraph markup.  This is because
the subsequent ones are allowed to be different types of blocks, not
just paragraphs, so Asciidoc has to use the normal markup for them.
The first set of text is of course a list item block not a separate
block so it has to be marked up by the list markup.

Should it be changed?  Not sure, the <p> elements inside the list
items are part of the list as I said above, not sure it really is a
"paragraph".
The div could probably be removed from paragraphs, except that someone
may rely on it.  It would be in a major version change it it happened
(but we need to figure out how to do minor versions first :).

Cheers
Lex

>
> (asciidoc 8.6.9 default package on Ubuntu 14.04, command line "asciidoc
> myfilename.txt")
>
> --
> Stéphane Gourichon
>
> --
> You received this message because you are subscribed to the Google Groups
> "asciidoc" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/asciidoc.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to