Automattic / Automattic/jetpack

Markdown not parsing paragraphs and lists in lists properly

Open
#1,118 4 comments 1 reaction 1 assignee Claimed by @mattwiebe View on GitHub
[Feature] Markdown [Pri] Low [Status] Auto-allocated Bug Good For Community
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

**Updated** to include more buggy examples. Bugs have been verified against [Markdown Web Dingus](http://daringfireball.net/projects/markdown/dingus) and [PHP Markdown Dingus](https://michelf.ca/projects/php-markdown/dingus/). Look for _'(notice here)'_ in the outputs shown below to identify the bugs.
## Paragraphs in lists

Consider this example:

```
- list point 1 para 1

list point 1 para 2

- list point 2 para 1

list point 2 para 2
```

The output is like this...

```



  • list point 1 para 1 (notice here)

    list point 1 para 2




  • list point 2 para 1


    list point 2 para 2




```

When it should be like this:

```



  • list point 1 para 1


    list point 1 para 2




  • list point 2 para 1


    list point 2 para 2




```
## Lists in lists

**Scenario (1):** Consider these examples:

```
- list point 1
- sub-list 1.1
- sub-list 1.2

- list point 2
- sub-list 2.1
- sub-list 2.2
```

(and)

```
- list point 1

- sub-list 1.1
- sub-list 1.2

- list point 2

- sub-list 2.1
- sub-list 2.2
```

The output is like this...

```



  • list point 1 (notice here)

    • sub-list 1.1

    • sub-list 1.2




  • list point 2 (notice here)

    • sub-list 2.1

    • sub-list 2.2




```

When it should be like this:

```



  • list point 1



    • sub-list 1.1

    • sub-list 1.2




  • list point 2



    • sub-list 2.1

    • sub-list 2.2




```

**Scenario (2):** Consider this example:

```
- list point 1

- sub-list 1.1

- sub-list 1.2

- list point 2

- sub-list 2.1

- sub-list 2.2
```

The output is like this...

```



  • list point 1 (notice here)

    • sub-list 1.1 (notice here)


    • sub-list 1.2





  • list point 2



    • sub-list 2.1 (notice here)


    • sub-list 2.2





```

when it should be like this:

```



  • list point 1



    • sub-list 1.1


    • sub-list 1.2





  • list point 2



    • sub-list 2.1


    • sub-list 2.2





```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.