mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Dont support single row or column tables in HTML to Markdown conversion
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user