Firstly, thanks to everyone for their help and suggestions. Sorry John, I could not go back to an older version (homebrew). So I guess something else has changed? Perhaps a fuller explanation might help:

What we are doing is extracting some YAML frontmatter metadata into variables for a bash script. We use the following (simplified) command
pandoc --lua-filter remove-meta-html.lua -f markdown+yaml_metadata_block  book-metadata-file.md --template meta-data.template  --to html -o file.tmp

remove-meta-html.lua
function Pandoc(doc)
 for k,v in pairs(doc.meta) do
  if v.t == 'MetaBlocks' then
   for i,x in ipairs(v) do
     if x.t == 'Para' then v[i] = pandoc.Plain(v[i].c) end
   end
  end
 end
 return doc
end


The meta-data.template has lines like:
$if(volume)$BOOK_VOLUME="$volume$"$endif$

We then read the variables from the created file.tmp.

This has worked for some time, can anyone one see anything that would need to be corrected or could have changed in recent versions?
On Friday, 21 January 2022 at 08:24:36 UTC BP wrote:
Or if needed use single quotes around the value to protect punctuation marks, noting that to include a single quote in a YAML single-quoted string you use two single quotes, as in `'don''t'`.

Den tors 20 jan. 2022 22:42John MacFarlane <j...-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> skrev:

One workaround is to use a Lua filter that
applies pandoc.utils.stringify to the contents of the
'volume' field in metadata.

Russ <in...@shoesforindustry.net> writes:

> pandoc 2.17.0.1
> Reading a multi line YAML front matter and outputing the text now gets a
> text string with html <p> tags.
>
> For example
> ```yaml
> volume: | Volume 16: A Subtitle ```
> Should produce:
> "Volume 16: A Subtitle"
>
> But now produces:
> "<p>Volume 16: A Subtitle</p>"
>
> Is there a way to avoid these html tags or is it a bug? I cannot say for
> sure that this has changed in this specific version, but it is certainly
> quite a recent change.
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/e17cd72d-2900-476c-a945-77d9e2e722bcn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/cef14d70-eda9-4555-85ec-a39e71fabf29n%40googlegroups.com.