Test: Malformed Gallery and Link-Preview Blocks

1 min read

Testing error handling for malformed gallery and link-preview blocks

Malformed Block Error Handling Tests

This page tests how the markdown processor handles malformed gallery and link-preview blocks.

Missing closing marker

:::gallery
images=[{"src": "/image1.jpg", "alt": "Test"}]

Invalid JSON syntax

:::gallery
images=[{"src": "/image1.jpg", "alt": "Test",}]
:::

Missing images array

:::gallery
caption="Test gallery"
:::

Empty images array

:::gallery
images=[]
:::

Missing closing marker

:::link-preview
url="https://example.com"
title="Example Domain"
description=""
thumbnail="null"
:::link-preview
title="Test"
:::

Invalid URL format

:::link-preview
url="not-a-valid-url"
:::

Empty URL

:::link-preview
url=""
:::

Valid Blocks (for comparison)

:::gallery
images=[{"src": "/image1.jpg", "alt": "Test"}]
:::
:::link-preview
url="https://example.com"
title="Example Domain"
description=""
thumbnail="null"
:::
Copyright 2025, Ran DingPrivacyTerms
Test: Malformed Gallery and Link-Preview Blocks - Dev Notes