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.
Markdown source
Markdown · 30 lines# 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
```
Rendered pages
PDF · 1 page · 12 KBThe sample documents describe invented organizations in several countries. All names and figures are illustrative.
Barcodes and QR codes in Markdown to PDF: every sampleIn the Markdown reference
