turndown-plugin-gfm
turndown-plugin-gfm copied to clipboard
Table with "<colgroup>" is considered as without header
Scenario: try to convert table with colgroup:
<table>
<colgroup><col /></colgroup>
<tbody>
<tr>
<td>content</td>
</tr>
<tr>
<td>content</td>
</tr>
</tbody>
</table>
Expected result: table is converted
Actual result: table kept as is.
This function seems to be adapted to handle this:
function isFirstTbody (element) {
var previousSibling = element.previousSibling;
return (
element.nodeName === 'TBODY' && (
!previousSibling ||
/* check if previousSibling is colgroup here? */
(
previousSibling.nodeName === 'THEAD' &&
/^\s*$/i.test(previousSibling.textContent)
)
)
)
}
Created a pull request #31 for this issue
Created a pull request #31 for this issue
I don't want to be pessimistic but there are also other unmerged PRs that wanted to fix things since 2018. But there wasn't a single commit to this plugin since then. Therefore, if I may give an advice: you might consider switching to this fork and direct your PR over there instead.
Thanks a lot. You are right. Seems redundant job I did there. Though table output not working 100% as I expect... I will further look at it.
No worries. It's not really obvious. It would be great if this repo would at least be archived and get an entry stating that it's not maintained anymore. But I didn't even get a response to that. :wink: