| Attribute | +Description | +
|---|---|
|
+ |
+
| Prop | +Type | +Default | ++ |
|---|
+
| Property | +Type | +Description | +
|---|---|---|
|
+ |
+
+ |
+
world'); + }); + + it('preserves multiple paragraphs', () => { + const result = renderInlineMarkdown('First paragraph.\n\nSecond paragraph.'); + expect(result).toContain('
{
+ const result = renderInlineMarkdown('Use `foo` here.');
+ expect(result).toContain(' {
+ const result = renderInlineMarkdown('```\nconst x = 1;\n```');
+ expect(result).toContain(' /, '').replace(/<\/p>$/, '');
+ }
+ return ` ${this.parser.parseInline(tokens)} ` wrapper so simple descriptions sit inline.
+ *
+ * If the output is a lone ` … ([\s\S]*)<\/p>$/);
+ if (match && !trimmed.includes(' {
+ const result = renderInlineMarkdown('**bold text**');
+ expect(result).toContain('bold text');
+ });
+
+ it('renders emphasized text', () => {
+ const result = renderInlineMarkdown('*italic text*');
+ expect(result).toContain('italic text');
+ });
+
+ it('renders links with correct classes', () => {
+ const result = renderInlineMarkdown('[link](https://example.com)');
+ expect(result).toContain('href="https://example.com"');
+ expect(result).toContain('underline');
+ expect(result).toContain('intent:no-underline');
+ });
+
+ it('renders unordered lists', () => {
+ const result = renderInlineMarkdown('- item one\n- item two');
+ expect(result).toContain(' {
+ const result = renderInlineMarkdown('1. first\n2. second');
+ expect(result).toContain('
{
+ const result = renderInlineMarkdown('# Heading');
+ expect(result).not.toContain('
{
+ const result = renderInlineMarkdown('before\n\n---\n\nafter');
+ expect(result).not.toContain('
{
+ const md = 'The volume level:\n\n- `0` — muted\n- `1` — max';
+ const result = renderInlineMarkdown(md);
+ expect(result).toContain('${this.parser.parseInline(tokens)}${text}`;
+ },
+
+ codespan({ text }) {
+ return `${text}`;
+ },
+
+ strong({ tokens }) {
+ return `${this.parser.parseInline(tokens)}`;
+ },
+
+ em({ tokens }) {
+ return `${this.parser.parseInline(tokens)}`;
+ },
+
+ link({ href, tokens }) {
+ return `${this.parser.parseInline(tokens)}`;
+ },
+
+ // --- Unsupported elements — downgrade or suppress ---
+
+ heading({ tokens }) {
+ return `