Files
hyprcrd/public/plugins/tests/markdown-edge.test.js
thandClaude Opus 4.6 088c225202 runner: bump RUNNER_V ?v=3 → ?v=4 so test-shield removal loads
The test-shield (#test-shield) was added in loader.js (always fresh
via plugin manager ?v=time()) but the removal lives in runner.js
hideProgress(). runner.js was still cached at ?v=3 in the browser,
so the shield stayed after the run. Bumping to ?v=4 in loader.js +
all 42 test files forces a fresh runner.js load.

chore: bump version to 0.9.15

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 11:04:23 +02:00

75 lines
2.6 KiB
JavaScript

import { describe, it, expect } from './runner.js?v=4';
import { renderMd } from '../../js/modules/markdown.js';
describe('Markdown: Blank Lines', () => {
it('image after blank lines renders', () => {
const html = renderMd('text\n\n\n\n![img](uploads/test.jpg)');
expect(html).toContain('<img');
expect(html).toContain('uploads/test.jpg');
});
it('image after single blank line renders', () => {
const html = renderMd('text\n\n![img](uploads/test.jpg)');
expect(html).toContain('<img');
});
it('image after many blank lines renders', () => {
const html = renderMd('text\n\n\n\n\n\n![img](uploads/test.jpg)');
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![img](test.jpg)\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('![a](one.jpg)\n\n\n\n![b](two.jpg)');
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>');
});
});