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

heading and list item not converted well #96

Open
caseykhuc opened this issue Oct 19, 2023 · 1 comment
Open

heading and list item not converted well #96

caseykhuc opened this issue Oct 19, 2023 · 1 comment

Comments

@caseykhuc
Copy link

Example HTML:

<ol>
   <h2>
      <li>Test heading</li>
   </h2>
   <h2>
      <li>Test heading 2</li>
   </h2>
</ol>

The expected rendering result should be like below:
image

However, with the converted markdown, headings just disappear:

## 
- Test heading


## 
- Test heading 2


image

@fogx
Copy link

fogx commented Feb 22, 2024

The provided example is not valid HTML. Per the HTML5 specifications <ol>'s may only contain <li>'s or other <ol> or <ul>'s .
https://www.w3.org/TR/2012/WD-html-markup-20120329/ol.html
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol

Using correct HTML structure, along with heading_style=ATX will give you the desired output

<ol>
   <li>
      <h2>Test heading</h2>
   </li>
   <li>
      <h2>Test heading 2</h2>
   </li>
</ol>
1. ## Test heading
2. ## Test heading 2

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

2 participants