From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30025 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Russ Newsgroups: gmane.text.pandoc Subject: Re: Reading a multi line yaml key - results in text surrounded in html

tags? Date: Fri, 21 Jan 2022 01:01:35 -0800 (PST) Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1154_641623907.1642755695305" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14699"; mail-complaints-to="usenet@ciao.gmane.io" To: pandoc-discuss Original-X-From: pandoc-discuss+bncBC77N3USRAPBB4HMVGHQMGQEWIPNJ7I-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Fri Jan 21 10:01:39 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-ot1-f60.google.com ([209.85.210.60]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nApnf-0003f6-I7 for gtp-pandoc-discuss@m.gmane-mx.org; Fri, 21 Jan 2022 10:01:39 +0100 Original-Received: by mail-ot1-f60.google.com with SMTP id t1-20020a9d7481000000b005919e9a1347sf5114040otk.2 for ; Fri, 21 Jan 2022 01:01:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:date:from:to:message-id:in-reply-to:references:subject :mime-version:x-original-sender:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:list-subscribe :list-unsubscribe; bh=RlrKBKRzE5o8vJfEQDJ2g/aFcfDpY+DU/R/f8P23VaI=; b=k0K/5996B5knU7fexJp7cI6woss7Bs5hI894+Z47vsT1TxHdQAwsW/5SLcv0qGluuv 49rruMne15joPWE2OeUlFYTiS+y+BWnIb17PnhKqDpMn6EE8FgY8ICPxD8VSa87+kZPG RogalWGgSTUm7SXIS56FirzAdYvoXiDU2WgdPMVvOsE8bp/MbxVB79ixq4EgfsFkSQZD bxVMD78HyrbcPSiac2dcesifqumrpqY4dy0TLpvqzVJMPaXzXYj/wORAvFua+tS7TPS4 nUkaUa9qnvELvtA9Z3jAp6vtSPJ/4ivbSeu9rnrUOqj7Y2a+YwdCQFp/iUbVxzBsoajG XIjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:date:from:to:message-id:in-reply-to :references:subject:mime-version:x-original-sender:reply-to :precedence:mailing-list:list-id:x-spam-checked-in-group:list-post :list-help:list-archive:list-subscribe:list-unsubscribe; bh=RlrKBKRzE5o8vJfEQDJ2g/aFcfDpY+DU/R/f8P23VaI=; b=TyQk8g/Jsdff19MGeIwCkAnNBvshnVY6DeqjSlwVPu5Tg3ip8LyAZP/42ei+BiMUiC 1Y4/YKp5Pd/3gHcdP2R0pL11mqPzXm2gHQdpy2j1VCAkeMRdhQ58dhyYZaUwuj7z9RN+ /snV5RFchkRLQ5GKI+yvGDHcKa67RHcp5CZcsg93BmrfDsC0WxhfBBJLrf3AXMh89E9d kfR8yOEki6jrerWzbee2mAsCQVAxzYIJ05bwal1UbfI4owUJ5sFQgPQ0K7lfUiPORvuL P09iRAcL4UUy+EDOtjjsZ1PhnDSJZCP+QtkBDmndOonuCkQzjjhH6o4d/fXCJIADCU2f V3sA== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM530ZzObIf+o0/A2Hl/0u212x79TnuxDBVn0AQBYxZAst5d0AoPiw /+Gv//ZLG0pzSuXjPc4lvng= X-Google-Smtp-Source: ABdhPJz5SpRXsjBAvvMK4wGq0J1mrdLdXOh86ki5mH+owYys1AT1GFlCDhK0dStSy6xpCkJE2acwSw== X-Received: by 2002:aca:acd5:: with SMTP id v204mr2380143oie.71.1642755698356; Fri, 21 Jan 2022 01:01:38 -0800 (PST) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:aca:ded5:: with SMTP id v204ls2824760oig.10.gmail; Fri, 21 Jan 2022 01:01:36 -0800 (PST) X-Received: by 2002:a05:6808:179e:: with SMTP id bg30mr10805342oib.138.1642755695926; Fri, 21 Jan 2022 01:01:35 -0800 (PST) In-Reply-To: X-Original-Sender: info-ckBjHRpK5r9MPTj2movljOTW4wlIGRCZ@public.gmane.org Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:30025 Archived-At: ------=_Part_1154_641623907.1642755695305 Content-Type: multipart/alternative; boundary="----=_Part_1155_554532579.1642755695305" ------=_Part_1155_554532579.1642755695305 Content-Type: text/plain; charset="UTF-8" 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 skrev: > >> >> One workaround is to use a Lua filter that >> applies pandoc.utils.stringify to the contents of the >> 'volume' field in metadata. >> >> Russ writes: >> >> > pandoc 2.17.0.1 >> > Reading a multi line YAML front matter and outputing the text now gets >> a >> > text string with html

tags. >> > >> > For example >> > ```yaml >> > volume: | Volume 16: A Subtitle ``` >> > Should produce: >> > "Volume 16: A Subtitle" >> > >> > But now produces: >> > "

Volume 16: A Subtitle

" >> > >> > 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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit >> https://groups.google.com/d/msgid/pandoc-discuss/yh480ksfti2igy.fsf%40johnmacfarlane.net >> . >> > -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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. ------=_Part_1155_554532579.1642755695305 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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) comman= d
pandoc --lua-filter remove-meta-html.lua -f markdown+ya= ml_metadata_block  book-metadata-file.md --template meta-data.templ= ate  --to html -o file.tmp

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


The meta-data.templ= ate has lines like:
$if(volume)$BOOK_VOLUME=3D"$volume$"$endi= f$

We then read the variables from the created fil= e.tmp.

This has worked for some time, can any= one 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 m= arks, 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...@shoesf= orindustry.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 f= or
> sure that this has changed in this specific version, but it is certain= ly
> quite a recent change.
>
> --
> You received this message because you are subscribed to the Google Gro= ups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send= an email to pandoc-d= iscus...-/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 &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pandoc-discus= ...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups &= quot;pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to pand= oc-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.
------=_Part_1155_554532579.1642755695305-- ------=_Part_1154_641623907.1642755695305--