Home > Enterprise >  pandoc error: [WARNING] Could not parse YAML metadata: Unexpected 'd'
pandoc error: [WARNING] Could not parse YAML metadata: Unexpected 'd'

Time:11-30

I am not sure why I get the following error message while converting markdown to PDF with a template:

[WARNING] Could not parse YAML metadata at line 10 column 1: Unexpected 'd'

Here is the command I use to build the document:

pandoc --template eisvogel -o output.pdf input.md

Here is the markdown file:

---
titlepage: true
title: Some title
author: [Author]
date: "2022-11-25"
colorlinks: true
disable-header-and-footer: true
---

# Quick Introduction 
A famous guy once said:

The error occurs when I add the disable-header-and-footer: true. If this line is not here, then the Pandoc processes the document.

CodePudding user response:

The space after the colon in the offending line is not a normal (ASCII) space but the Unicode character U 202F, "Narrow Non-Break Space". The YAML parser doesn't see a key-value pair but a single word because of that. Replace it with an ASCII space and everything should work.

  • Related