plugin infrastruktur
This commit is contained in:
1 parent
dd2a995f6c
commit
1545b90f39
43 files changed
No files matched your search
@@ -0,0 +1,74 @@
|
||||
import { describe, it, expect } from './runner.js';
|
||||
import { renderMd } from '../modules/markdown.js';
|
||||
|
||||
describe('Markdown: Blank Lines', () => {
|
||||
it('image after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n');
|
||||
expect(html).toContain('<img');
|
||||
expect(html).toContain('uploads/test.jpg');
|
||||
});
|
||||
|
||||
it('image after single blank line renders', () => {
|
||||
const html = renderMd('text\n\n');
|
||||
expect(html).toContain('<img');
|
||||
});
|
||||
|
||||
it('image after many blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n\n\n');
|
||||
expect(html).toContain('<img');
|
||||
});
|
||||
|
||||
it('heading after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n## Heading');
|
||||
expect(html).toContain('<h2');
|
||||
});
|
||||
|
||||
it('list after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n- item one\n- item two');
|
||||
expect(html).toContain('<li');
|
||||
});
|
||||
|
||||
it('code block after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n```\ncode\n```');
|
||||
expect(html).toContain('<code');
|
||||
});
|
||||
|
||||
it('hr after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n---');
|
||||
expect(html).toContain('<hr');
|
||||
});
|
||||
|
||||
it('todo after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n- [ ] task');
|
||||
expect(html).toContain('checkbox');
|
||||
});
|
||||
|
||||
it('wiki link after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n[[Some Card]]');
|
||||
expect(html).toContain('card-link');
|
||||
});
|
||||
|
||||
it('gallery block after blank lines renders', () => {
|
||||
const html = renderMd('text\n\n\n\n```gallery\n\n```');
|
||||
expect(html).toContain('md-gallery');
|
||||
});
|
||||
|
||||
it('multiple blank lines produce spacing but no broken content', () => {
|
||||
const html = renderMd('para 1\n\n\n\npara 2\n\n\n\n\npara 3');
|
||||
// All three paragraphs should render
|
||||
const pCount = (html.match(/<p>/g) || []).length;
|
||||
expect(pCount).toBeGreaterThan(1);
|
||||
});
|
||||
|
||||
it('blank lines between images both render', () => {
|
||||
const html = renderMd('\n\n\n\n');
|
||||
const imgCount = (html.match(/<img/g) || []).length;
|
||||
expect(imgCount).toBe(2);
|
||||
});
|
||||
|
||||
it('blank lines dont break bold/italic', () => {
|
||||
const html = renderMd('**bold text**\n\n\n\n*italic text*');
|
||||
expect(html).toContain('<strong>bold text</strong>');
|
||||
expect(html).toContain('<em>italic text</em>');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user