Turning list items into non-paragraphed list items

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

Turning list items into non-paragraphed list items

bodiam
Hi all,

At the moment, AsciiDoc is turning lists of items (the items marked with *'s) into <li><p>item</p></li>. I checked with Dan, and this is done to keep the compatibility with Python AsciiDoc. That's all fine by me, but when using AsciiDoc on (for example) GitHub (but it's also true for other HTML pages), the <li><p> is causing cosmetic issues where extra whitespace is rendered between the list items.

IMO, this creates not so nice looking documents (plus, the rendering of Markdown documents doesn't have this issue), and I would propose to have this 'fixed' by changing line items into simple <li>, instead of <li><p>.

However, this might break some styling, and maybe cause other issues which I'm currently unaware of, so I'm looking for input. What are your thoughts on this?

Thanks, Erik
Reply | Threaded
Open this post in threaded view
|

Re: Turning list items into non-paragraphed list items

mojavelinux
Administrator
Erik,

As you mentioned, this is one of those caveats we inherited from AsciiDoc Python and it is something we need to address.

There is an open issue about this topic in the issue tracker (see https://github.com/asciidoctor/asciidoctor/issues/1087).

As I explained in a comment (https://github.com/asciidoctor/asciidoctor/issues/1087#issuecomment-55512729), what I discovered when implementing clean room HTML5 for the EPUB3 converter is that if we simply remove the <p> element, it because extremely difficult to style both simple and complex lists. We still need some wrapper element around the list item text in order to control spacing. However, instead of a <p> element, we can use a <span> element so that it does not impact spacing when a dedicated stylesheet is absent (as it is on GitHub).

I took the idea one step further in the EPUB3 converter. The converter detects whether the list has any items that contain complex content (multiple blocks). If so, it puts extra space between list items so that the content doesn't look squashed. If the list only contains simple items, then it automatically compresses the list to look as we would expect.

All we need to do now is backport the logic from the EPUB3 converter to the built-in HTML5 converter (see https://github.com/asciidoctor/asciidoctor/issues/1221). I'm confident it will put us in a better position and look good on GitHub without any help from the stylesheet.

Cheers,

-Dan

On Thu, Nov 20, 2014 at 1:26 PM, bodiam [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi all,

At the moment, AsciiDoc is turning lists of items (the items marked with *'s) into <li><p>item</p></li>. I checked with Dan, and this is done to keep the compatibility with Python AsciiDoc. That's all fine by me, but when using AsciiDoc on (for example) GitHub (but it's also true for other HTML pages), the <li><p> is causing cosmetic issues where extra whitespace is rendered between the list items.

IMO, this creates not so nice looking documents (plus, the rendering of Markdown documents doesn't have this issue), and I would propose to have this 'fixed' by changing line items into simple <li>, instead of <li><p>.

However, this might break some styling, and maybe cause other issues which I'm currently unaware of, so I'm looking for input. What are your thoughts on this?

Thanks, Erik


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Turning-list-items-into-non-paragraphed-list-items-tp2479.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Turning list items into non-paragraphed list items

bodiam
Hi Dan,

I think replacing the <p> with a  would be a great improvement indeed. It would probably make the default rendering ok in almost all places (eg, Github, but I also noticed the IntelliJ AsciiDoc is affected by this). I can make a custom CSS for that, but that would only solve it in one place.

Thanks for providing the links btw, I wasn't aware this had been mentioned so many times already. All the more reason to fix it, I guess!

Backporting seems like a good idea, and 1.6.0 seems like a good candidate for this, if you follow semantic versioning. Definitely a +1 from me for implementing this ASAP!