# Barcode validation and fallback in Markdown

A wrong barcode never breaks the document: options a symbology cannot use are ignored with a warning, and a rejected payload shows as code with the reason.

The fence never breaks a document: options the symbology cannot use are ignored with a warning, and a payload the encoder rejects falls back to a code block with the error beneath.

- PDF: https://legivel.com/examples/barcodes-qr-codes/barcode-validation.pdf
- Page: https://legivel.com/examples/barcodes-qr-codes/barcode-validation
- Open in the editor: https://legivel.com/markdown-to-pdf?sample=barcode-diagnostics
- More barcodes and QR codes in Markdown to PDF: https://legivel.com/examples/barcodes-qr-codes

## Markdown source

````markdown
# Predictable failure

A QR option on a 1D type is ignored, and the barcode still renders:

```barcode
type: ean13
data: 5901234123457
module-shape: rounded
```

An invalid payload renders as a code block plus the error message:

```barcode ean13
not-a-number
```

A wrong check digit is caught too:

```barcode ean13
5901234123450
```

Switch `type:` freely; compatible styling survives the move:

```barcode
type: aztec
data: same style, new symbology
module-color: #1a3a8f
module-gradient: linear 45 #1a3a8f #d53f2a
```
````
