Dont support single row or column tables in HTML to Markdown conversion

This commit is contained in:
Vinoth Kannan
2017-12-21 12:58:57 +05:30
parent 6ecf37c482
commit 129d924c0d
2 changed files with 27 additions and 4 deletions

View File

@@ -109,7 +109,7 @@ QUnit.test("converts table tags", assert => {
});
QUnit.test("returns empty string if table format not supported", assert => {
const html = `<table>
let html = `<table>
<thead> <tr><th>Headi\n\nng 1</th><th>Head 2</th></tr> </thead>
<tbody>
<tr><td>Lorem</td><td>ipsum</td></tr>
@@ -117,6 +117,18 @@ QUnit.test("returns empty string if table format not supported", assert => {
</table>
`;
assert.equal(toMarkdown(html), "");
html = `<table>
<thead> <tr><th>Heading 1</th></tr> </thead>
<tbody>
<tr><td>Lorem</td></tr>
<tr><td><i>sit amet</i></td></tr></tbody>
</table>
`;
assert.equal(toMarkdown(html), "");
html = `<table><tr><td>Lorem</td><td><i>sit amet</i></td></tr></table>`;
assert.equal(toMarkdown(html), "");
});
QUnit.test("converts img tag", assert => {