Skip to content

Ordered lists with bolded numbers not rendering in an <ol> element #932

@extrange

Description

@extrange

Initial checklist

Affected package

react-markdown 10.1.0

Steps to reproduce

import Markdown from 'react-markdown'

const markdown = `
list
1. item 1
2. item 2

list with bolded numbers
**1.** item 2
**2.** item 2

`

function App() {
  return <Markdown>{markdown}</Markdown>
}

export default App

Stackblitz reproduction

Actual behavior

Renders as

<p>list</p>
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
<p>list with bolded numbers
<strong>1.</strong> item 2
<strong>2.</strong> item 2</p>

Expected behavior

Bolded numbers in an ordered list should be ignored, i.e. the output should be

<p>list</p>
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>
<p>list with bolded numbers
<ol>
<li>item 1</li>
<li>item 2</li>
</ol>

Runtime

[email protected]

Package manager

[email protected]

Operating system

N/A (stackblitz)

Build and bundle tools

Vite

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