Skip to content

In nested lists, line breaks after one bullet point applies margins to all following bullet points #916

@7tint

Description

@7tint

Initial checklist

Affected package

[email protected]

Steps to reproduce

import Markdown from 'react-markdown'

function App() {
  const markdown =`

1. **A1**
      * B1
      * B2
2. **A2**
      * B1
      * B2
`

const markdown2 = `
1. **A1**

      * B1
      * B2
2. **A2**
      * B1
      * B2
`

  return (
    <div className="App">
      <Markdown>{markdown}</Markdown>
      <br />
      <Markdown>{markdown2}</Markdown>
    </div>
  );
}

export default App;

Produces:
Image

Actual behavior

In this example, markdown2's A2 is also contained in a <p> tag, which adds unintended margin

Actual:
Image

Expected behavior

We expect this break to only add spacing to A1 (via the <p> tag), and not A2.

Expected:

Image

Runtime

No response

Package manager

No response

Operating system

No response

Build and bundle tools

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    👎 phase/noPost cannot or will not be acted on🙋 no/questionThis does not need any changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions