gd2md-html icon indicating copy to clipboard operation
gd2md-html copied to clipboard

Nested tables in lists get mangled

Open nvillahermosa opened this issue 8 years ago • 1 comments

Hello again!

While I continue busily pushing the envelope of your excellent script, I've discovered a consistent issue with tables nested in (ordered) lists. The script creates the following, comments mine:

<li> Enter the following:
<table>
                    <tbody>
                        <tr>
                            <td>
                                <strong>Heading Cell 1</strong>
                            </td>
                        </tr>
                    </tbody>
                </table>
    </li>
</ol> <-- creates a closing tag
<p>
    <strong>Heading Cell 2</strong> <-- heading gets its own paragraph
</p>
<p> <-- contents get dumped here
    Row 1 Cell 1Row 1 Cell 2
    Row 2 Cell 1Row 2 Cell 2
    Row 3 Cell 1Row 3 Cell 2</p>
<ol> <-- opens a new list for the following step

nvillahermosa avatar Nov 16 '17 15:11 nvillahermosa

Yeah, there are a number of issues here. Thanks for noticing this case.

Did you convert to Markdown or HTML?

In my testing, a table that's indented under a list item, when converted to Markdown, is not indented to be under the containing list item. The same table, converted to HTML, also is not indented, but the following list item is indented to the next level. This is a bug with the HTML conversion that I'll work on next.

The table-in-list-item is a relative edge case, but I'll check it out eventually.

evbacher avatar Nov 17 '17 04:11 evbacher