Skip to content

heading and list item not converted well #96

Closed as not planned
Closed as not planned

Description

@caseykhuc

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

Activity

  1. fogx commented on Feb 22, 2024

    @fogx

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions