Conflict between numbered headings and lists #506

Closed
candlerb opened this Issue May 7, 2012 · 2 comments

Comments

Projects
None yet
2 participants

candlerb commented May 7, 2012

The following pandoc renders strangely with markdown2pdf (1.8.2.1 under OSX)

1. First part
-------------

Here is some stuff.

a) a point
b) another point

2. Second part
--------------

Unfortunately:

* heading 2 is treated as part of the preceding list

* so it gets numbered as (c)

        $ markdown2pdf mytest.txt

3. Another thing
----------------

That heading loses its number and is indented

4. Finally
----------

Something odd when I use another code block here:

    $ markdown2pdf mytest.txt

This one renders with a bullet!

However it works fine if you change all the headings to the alternative form where each one is prefixed with two hashes, instead of being underlined with dashes.

## 1. First part

Here is some stuff.

...etc

It also renders OK if I remove the numbers from each heading line (which is not so good a workaround because I want my headings to have numbers on then)

But it looks like there is some tension here between an underlined piece of text being a heading (H1/H2) and a line starting with N. being part of a numbered list. Perhaps the former should take precedence over the latter?

Owner

jgm commented May 8, 2012

I don't have 1.8.2.1 around to test. But I tested your example
with pandoc 1.9.2 (the latest released version), and it rendered
perfectly.

Why not upgrade?

(Note: pandoc 1.9 no longer has a separate markdown2pdf script.
You just do pandoc -o outfile.pdf.)

+++ Brian Candler [May 07 12 16:12 ]:

The following pandoc renders strangely with markdown2pdf (1.8.2.1 under OSX)

1. First part
-------------

Here is some stuff.

a) a point
b) another point

2. Second part
--------------

Unfortunately:

* heading 2 is treated as part of the preceding list

* so it gets numbered as (c)

        $ markdown2pdf mytest.txt

3. Another thing
----------------

That heading loses its number and is indented

4. Finally
----------

Something odd when I use another code block here:

    $ markdown2pdf mytest.txt

This one renders with a bullet!

However it works fine if you change all the headings to the alternative form where each one is prefixed with two hashes, instead of being underlined with dashes.

## 1. First part

Here is some stuff.

...etc

It also renders OK if I remove the numbers from each heading line (which is not so good a workaround because I want my headings to have numbers on then)

But it looks like there is some tension here between an underlined piece of text being a heading (H1/H2) and a line starting with N. being part of a numbered list. Perhaps the former should take precedence over the latter?


Reply to this email directly or view it on GitHub:
#506

candlerb commented May 8, 2012

Why not upgrade?

Only because I didn't realise there was a new dpkg :-)

I have now installed 1.9.2 and this test case and my original document work fine. Thank you!

@candlerb candlerb closed this May 8, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment