Markdown is confused by quoted text inside a list inside a list

Matt Kraai kraai at ftbfs.org
Tue Dec 18 01:07:23 EST 2007


Howdy,

The following bug report was submitted to the Debian bug tracking
system. I verified that the problem it describes is still present in
the latest beta.

If you reply to this message, please preserve the CC to
456595-forwarded at bugs.debian.org.

----- Forwarded message from Daniel Burrows <dburrows at debian.org> -----

From: Daniel Burrows <dburrows at debian.org>
Subject: Bug#456595: Markdown is confused by quoted text inside a list inside a
list.
To: Debian Bug Tracking System <submit at bugs.debian.org>
Date: Sun, 16 Dec 2007 12:42:12 -0800

Package: markdown
Version: 1.0.1-7
Severity: normal

This example of quoted text inside a list works perfectly, as the
Markdown syntax documentation says it should:

-- snip here --
* Foo.

* Bar:

> Some quoted text inside Bar.

More of Bar.

* Baz.
-- snip here --

Running markdown over this produces the expected HTML:

-- snip here --
<ul>
<li><p>Foo.</p></li>
<li><p>Bar:</p>

<blockquote>
<p>Some quoted text inside Bar.</p>
</blockquote>

<p>More of Bar.</p></li>
<li><p>Baz.</p></li>
</ul>
-- snip here --


However, if the <ul> is inside another <ul>, Markdown gets horribly
confused:

-- snip here --
+ Item 1.

+ Item 2:

* Foo.

* Bar:

> Some quoted text inside Bar.

More of Bar.

* Baz.
-- snip here --

Markdown turns this into:

-- snip here --
<ul>
<li><p>Item 1.</p></li>
<li><p>Item 2:</p>

<ul>
<li><p>Foo.</p></li>
<li><p>Bar:</p></li>
</ul>

<blockquote>
<p>Some quoted text inside Bar.</p>
</blockquote>

<p>More of Bar.</p>

<ul>
<li>Baz.</li>
</ul></li>
</ul>
-- snip here --

Note that the inner <ul> is closed before the blockquote and re-opened
at the next <li>. I think this behavior is surprising; I would have
expected the blockquote and following text to be part of the <ul>.

It appears that there's a workaround: adding extra indents to the
list item in question and the blockquote gives me what I would expect on
output:

-- snip here --
+ Item 1.

+ Item 2:

* Foo.

* Bar:

> Some quoted text inside Bar.

More of Bar.

* Baz.
-- snip here --

compiles to:

-- snip here --
<ul>
<li><p>Item 1.</p></li>
<li><p>Item 2:</p>

<ul>
<li><p>Foo.</p></li>
<li><p>Bar:</p>

<blockquote>
<p>Some quoted text inside Bar.</p>
</blockquote>

<p>More of Bar.</p></li>
<li><p>Baz.</p></li>
</ul></li>
</ul>
-- snip here --

Daniel

-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-3-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages markdown depends on:
ii perl 5.8.8-12 Larry Wall's Practical Extraction

markdown recommends no packages.

-- no debconf information



----- End forwarded message -----

--
Matt


More information about the Markdown-Discuss mailing list