/', () => {
const md = [
'| Plattform | Pris |',
'| --- | --- |',
'| Azure | Høy |',
'| Foundry | Lav |',
].join('\n');
const html = markdownToHtml(md);
assert.match(html, //);
assert.match(html, //);
assert.match(html, /| /);
// header cells render as | , body values as |
assert.match(html, / | Plattform<\/th>/);
assert.match(html, / | Azure<\/td>/);
// the separator row must NOT become a data row
assert.doesNotMatch(html, / | ---<\/td>/);
});
test('empty input produces no table', () => {
assert.doesNotMatch(markdownToHtml(''), //);
});
test('tolerates a malformed row (uneven cell count) without throwing', () => {
const md = [
'| a | b |',
'| --- | --- |',
'| only-one-cell |',
'| x | y |',
].join('\n');
let html;
assert.doesNotThrow(() => { html = markdownToHtml(md); });
assert.match(html, //);
assert.match(html, /| x<\/td>/);
});
});
describe('markdownToHtml — heading levels # … #### (beslutning H)', () => {
test('# renders | | |