Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-paragraph list items are not working #128

Closed
jgm opened this issue Jun 10, 2011 · 2 comments
Closed

multi-paragraph list items are not working #128

jgm opened this issue Jun 10, 2011 · 2 comments
Assignees

Comments

@jgm
Copy link
Owner

jgm commented Jun 10, 2011

according to official markdown:
http://daringfireball.net/projects/markdown/syntax#list

multi-paragraph lists such as:

  1. This is a list item with two paragraphs. Lorem ipsum dolor
    sit amet, consectetuer adipiscing elit. Aliquam hendrerit
    mi posuere lectus.

Vestibulum enim wisi, viverra nec, fringilla in, laoreet
vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
sit amet velit.
2. Suspendisse id sem consectetuer libero luctus adipiscing.

are supported. However, trying the above on pandoc 1.5.1.1 and also the
"try pandoc" web script, puts the 2nd paragraph in the first list, outside
of the list item.

Google Code Info:
Issue #: 238
Author: infinity0x
Created On: 2010-05-11T09:58:20.000Z
Closed On: 2010-05-11T18:56:19.000Z

@ghost ghost assigned jgm Jun 10, 2011
@jgm jgm closed this as completed Jun 10, 2011
@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

oh wait, my mistake. the example presented does work, but the example i was testing
with doesn't, because i was using 2-space indents rather than 4-space indents.

however, it would be nice if support for that was added to pandoc. ie. make the next
paragraph part of the list-item, if it's indented by the same amount as the first
paragraph in the list-item.

Google Code Info:
Author: infinity0x
Created On: 2010-05-11T10:00:25.000Z

@jgm
Copy link
Owner Author

jgm commented Jun 10, 2011

Restructured text works that way. But pandoc follows the four-space rule that is implicit in the official
markdown syntax documentation (though not followed strictly by Markdown.pl). All block-level elements inside
a list item must be indented four spaces.

For more discussion of this, you can search the pandoc-discuss list for "four-space rule." It comes up frequently.

Google Code Info:
Author: [email protected]
Created On: 2010-05-11T18:56:19.000Z

jgm added a commit that referenced this issue Feb 27, 2017
jgm added a commit that referenced this issue Aug 19, 2017
Closes #3511.

Previously pandoc used the four-space rule: continuation paragraphs,
sublists, and other block level content had to be indented 4
spaces.  Now the indentation required is determined by the
first line of the list item:  to be included in the list item,
blocks must be indented to the level of the first non-space
content after the list marker. Exception: if are 5 or more spaces
after the list marker, then the content is interpreted as an
indented code block, and continuation paragraphs must be indented
two spaces beyond the end of the list marker.  See the CommonMark
spec for more details and examples.

Documents that adhere to the four-space rule should, in most cases,
be parsed the same way by the new rules.  Here are some examples
of texts that will be parsed differently:

    - a
      - b

will be parsed as a list item with a sublist; under the four-space
rule, it would be a list with two items.

    - a

          code

Here we have an indented code block under the list item, even though it
is only indented six spaces from the margin, because it is four spaces
past the point where a continuation paragraph could begin.  With the
four-space rule, this would be a regular paragraph rather than a code
block.

    - a

            code

Here the code block will start with two spaces, whereas under
the four-space rule, it would start with `code`.  With the four-space
rule, indented code under a list item always must be indented eight
spaces from the margin, while the new rules require only that it
be indented four spaces from the beginning of the first non-space
text after the list marker (here, `a`).

This change was motivated by a slew of bug reports from people
who expected lists to work differently (#3125, #2367, #2575, #2210,
 #1990, #1137, #744, #172, #137, #128) and by the growing prevalance
of CommonMark (now used by GitHub, for example).

Users who want to use the old rules can select the `four_space_rule`
extension.

* Added `four_space_rule` extension.
* Added `Ext_four_space_rule` to `Extensions`.
* `Parsing` now exports `gobbleAtMostSpaces`, and the type
  of `gobbleSpaces` has been changed so that a `ReaderOptions`
  parameter is not needed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant