I have recently begun using Markdown + PHP Md Extra + SmartyPants in
the Symphony XML-based CMS. I'm not sure if this is a Symphony
question, or one that can be answered here. I hope someone will tell
me. :) I've done my best to find an answer in the online
documentation, but drawn a blank.
When I use nested lists -- it doesn't matter whether <ol> or
<ul>,
there is always a blank line forced after the second level list is
complete before returning to level one. Examples:
MARKDOWN Ex. 1:
1. one
2. one-one
2. one-two
1. two
1. three
Ex. 2:
- first
- second
+ and this
+ and that
- third
OUTPUT Ex. 1:
1. one
1. one-one
2. one-two
2. two
3. three
Ex. 2:
* first
* second
o and this
o and that
* third
HTML PRODUCED Ex. 1:
<ol>
<li>one
<ol>
<li>one-one</li>
<li>one-two</li>
</ol></li>
<li>two</li>
<li>three</li>
</ol>
Ex. 2:
<ul>
<li>first</li>
<li>second
<ul>
<li>and this</li>
<li>and that</li>
</ul></li>
<li>third</li>
</ul>
Is the "blank line" expected? Can I get rid of it?!
Thanks for any help with this!
David.
--
David Reimer
Edinburgh, UK
djreimer at gmail.com
David Reimer wrote:> When I use nested lists -- it doesn't matter whether <ol> or <ul>, > there is always a blank line forced after the second level list is > complete before returning to level one. Examples:It's a CSS issue, not a markup issue. If you're using browser defaults, you're most likely seeing a default `margin-bottom: 1em;` on <ul>s and <ol>s. When you have a single list, that margin-bottom is probably expected and therefore unnoticed; with nested lists it's noticeable, and perhaps undesirable. There are lots of ways to fix it, some quite exotic. Here's a simple one: ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; } This sets a zero margin for the bottom of any list (excluding definition lists) contained within another list. Generally, it's best to zero all whitespace defaults and apply your own instead. User-agent defaults are unreliable. http://leftjustified.net/journal/2004/10/19/global-ws-reset/ http://developer.yahoo.com/yui/reset/ LQ
Lou Quillio wrote:> It's a CSS issue, not a markup issue. ...I included your simple fix in my CSS, and hey presto! Nailed it. I did turn up some "nested lists" + "blank lines" discussion after posting my question, but never ran across this precise issue. So, many thanks for this, Lou! D. -- David Reimer Edinburgh, UK djreimer at gmail.com