From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/28985 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean McDaniel Newsgroups: gmane.text.pandoc Subject: Re: Prevent backslash escaping and kept YAML header in Pandoc Markdown to PHP Extra Markdown conversion Date: Mon, 9 Aug 2021 16:56:17 -0400 Message-ID: References: <0c95effe-7e6e-4974-a7b7-5981b6b46ed4n@googlegroups.com> Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000078db3a05c9269e93" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16939"; mail-complaints-to="usenet@ciao.gmane.io" Cc: pandoc-discuss To: John MacFarlane Original-X-From: pandoc-discuss+bncBCQZFQXCXYGRB7FMY2EAMGQEN4IMN3Q-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mon Aug 09 22:56:31 2021 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-io1-f59.google.com ([209.85.166.59]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mDCJz-0004Ar-2s for gtp-pandoc-discuss@m.gmane-mx.org; Mon, 09 Aug 2021 22:56:31 +0200 Original-Received: by mail-io1-f59.google.com with SMTP id u22-20020a5d9f560000b02905058dc6c376sf13171578iot.6 for ; Mon, 09 Aug 2021 13:56:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1628542590; cv=pass; d=google.com; s=arc-20160816; b=PdP03GHSBT6vR32HueAlRnLdHh9MW4vEwJatFBnWBgP2/0h+Xp5Vo2aDfwDlakxhyY mZQudzApBGk3YyTtqAcqfSNGyOMfKNNbApcYhtiLbRuG5yhYJxh4x8Rc7rLlLh+TyBgF lObPeulmOPIkK4z9RMJp7pHMT9tqHKQ2beDraU55ct0aTasE5UgTh/xoVDqalD7t6+co +YYvTVmkgAxE4pGDwUCokSoiFWtNb3V/mjx7dkRBEUqk/sJxz5DnUxIgza5d+pa2XV3C 7GKWbTjpZ3HtzMCVM/RguRn1LPIKw8qn+kbjaA93wY3mbO4R+h+MOzsqwW8Y/KNOwIic M1kQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:cc:to:subject:message-id :date:from:in-reply-to:references:mime-version:sender:dkim-signature :dkim-signature; bh=FeUw6bgtzzqxHUuQudq+74ZBPET4SkwkG7OR2Uf0C18=; b=Be/8AIkpkU6Kd3cAlfiMIfpgw4QWO7iwVtqLvI73Z3dgtFL7CwZPtxKks9Nza6uPRt WoAaN1cGuFJR79gpkCezvwkUAH5ohO8mBDE6YZ+h3GCkNO0QZgdAST1HUcYKVb4vv6Uo qeFqIJSDi1UmdLGM6ytDsiMdN1jujhWTu2ECpwdMj0IqM3ZBi/NIkLVBtZ98eHOSRDqy bXvuanGI3FXx6GIAR7lu/j1TPhTjuFIyGSFdJnGoTTDaaG71IoNbLgHP5D1EwVUhNQAx dwgVxMGX2o6qfzAhJsf0qtW00mizFCBN0SLnoLElVoCvbyGVptyhiIh9Fti/QATFc9qE kpyg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+YybqP2; spf=pass (google.com: domain of sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::133 as permitted sender) smtp.mailfrom=sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:mime-version:references:in-reply-to:from:date:message-id :subject:to:cc:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=FeUw6bgtzzqxHUuQudq+74ZBPET4SkwkG7OR2Uf0C18=; b=YYBtxF+SIhF7a6B6IXpFI+tVc2e9ChhNQkSpWAhNu/TE3nncWAZtwpB42/rUEuvxk9 lsia4DmbZ1vKv4buOSiYBfyL+6qfSiWXrrwDGXXiYhwu9ekIKf3gtLY/a/uQzNA7hFdW dKk3aI0jheGI4H7wwqhM+Nlz8F2ZTiAid/0HrHl7PqJQ3aBNZZ5vaHrGXdWpJdjuRBfL yfEDTTVbFqDhB3gHtepI7HZCQXFTQA6ZbRQOeJV+Ipd7imuSNQHM2Wksre0/C8qwG6g8 I0OUiJtSpyEqsKK1tFsG9NS/PnmAlN5vpYs5iOtu9trPXB+Z6ugWV5Nu7uLWzdkjlpda 2SDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=FeUw6bgtzzqxHUuQudq+74ZBPET4SkwkG7OR2Uf0C18=; b=kthlw5Gwcbo+rn9FwGoPZ53scci9wD/fl3Oim8WcNBCPx03JnI4Vu0lrT2MOJv2DoE OXZ3GE2YNw/nKeDkgyZ9irgdNqFWjoAAfEZCAle/ONyzSv5GP9qj7H2GBcyqM2lPwFF8 bKwIYQxF87HYAbL0I/q08TncJ2YB1myywtiaoiamFIvMMMJ2JQibxFMOXYOdAEpJ66Jg bYB6NdetlgIDIG0HHpazpbznDbCl3/atICia5/mNnIkBJlHb9AvjANpgBaudmll2LL4d Ln0cxaQ57glmgNqQiodB2AVlvv2ACHk0QHFQbw0nlw14BQikpblx41h+VQ59W6uC8yYm LOyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:references:in-reply-to:from :date:message-id:subject:to:cc:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=FeUw6bgtzzqxHUuQudq+74ZBPET4SkwkG7OR2Uf0C18=; b=nYoFpD0B0/IeVwR4u8RgBGzX4dIPp8JYYmR13UOeJ0oMC8tKMlLeTlF5JbikproIWy poGj1K7lN6paLGkWxQryoJPZ9QjPJ4Mv6D3bb6ddzNSZEABSR1BjCM0R1bCGqVciWypZ LIq49j6enrpTXqcsemXdEfIkDfiWs0w0B1FlZ4dzQQZepB2kR19IXJzg0aFmtnyKbfh2 a4s3LlMFY6o5LNyDsJmFwZBnojKiYI8mYvOZXGJ9CI3roEh0UvL7QJSxWgWcLRNUZuG+ a2d4/PZRm7DdZbggf9G+94gMIIsP009xpb3uDHQaJSa46vbm3pk/s1jPyMZ8rmSeBLgc X26Q== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM531w8VkDx4F96oU2Z1pJ1nzjEpN8sDY1T7fJOGYurow2+RGAkff+ EfnXOcoegwjtuolAWDDBYJ0= X-Google-Smtp-Source: ABdhPJxEcIGBTzmP8kaLdntKNqXnmXWotmpJn5wvkpYPGX7+qZ6YBItZFmBi8vxAZ/X9ski63U+fMg== X-Received: by 2002:a05:6638:3804:: with SMTP id i4mr15075083jav.82.1628542590028; Mon, 09 Aug 2021 13:56:30 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a6b:f710:: with SMTP id k16ls2713742iog.4.gmail; Mon, 09 Aug 2021 13:56:28 -0700 (PDT) X-Received: by 2002:a6b:28a:: with SMTP id 132mr287878ioc.157.1628542588514; Mon, 09 Aug 2021 13:56:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628542588; cv=none; d=google.com; s=arc-20160816; b=X0GmKfdaw0d6QDHr60vigWf7daziryG2Y4eNws8BhdDCASOtEo23hjblKn3sUseWtY wYfzrOkA7JRfJ6VfyQiNsSJtc+GNVvf+uJXJyg2baRs1+JSL/b7W9oLC6ivru5oYRhzj 9701mOPLzTlpFzk2VkGz1HyiQvM470V9dJY7+yRdrdujAUOg/Bcm4AJImNjjP2xekMDT XTqnUXKMPKJL+0RIipJTeXFkIwjvSkfLp8ZtJeQkAZTegayYp6TvV3/WcSu4Fevx4uqK Qkvvf3j3x896Y0zkzWeBZGjmxPaviUerrNSllpPfnPzF1m/Xwq347fTtF8AUj38J7eEt 55YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=G01N+XN2N05UvJAe4UOIL86pEyswOm2JRvQUBUjCJqM=; b=jH2YiLP4v/Y17Cy1DF8POmVPEcm2yLqXUEwtN6SadgEC6JKt+gOpmzwPd5+M3oOrP1 E8hmnjJKBWn82z0MSN/f2MFvDM+W4Gk97pMkDdv8qWLFIQHRuH18PVsJDNGtmdkJ5/3j 7FjnALp9HnbArGK8rh7N6LK9VkU/nxIVfVBqelCzoH3UXUwfUnx18qesXWVYhnMmjCec EGe0dDgD/ktwBjXMZcajFcc50kckw4p1EEVLTgQnb0ePikvAZQH9H+w7psThvqhRRZdY iOK7gdduOeZSLpD6GEiSO4Mb1UVADWZ22rpyWT+U5QfAtHcQm48MWm2hXHb7WgoN5RFZ ioNQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+YybqP2; spf=pass (google.com: domain of sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::133 as permitted sender) smtp.mailfrom=sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-il1-x133.google.com (mail-il1-x133.google.com. [2607:f8b0:4864:20::133]) by gmr-mx.google.com with ESMTPS id k11si190395iov.3.2021.08.09.13.56.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 13:56:28 -0700 (PDT) Received-SPF: pass (google.com: domain of sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::133 as permitted sender) client-ip=2607:f8b0:4864:20::133; Original-Received: by mail-il1-x133.google.com with SMTP id k3so12975926ilu.2 for ; Mon, 09 Aug 2021 13:56:28 -0700 (PDT) X-Received: by 2002:a92:7b10:: with SMTP id w16mr491082ilc.241.1628542588208; Mon, 09 Aug 2021 13:56:28 -0700 (PDT) In-Reply-To: X-Original-Sender: sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=r+YybqP2; spf=pass (google.com: domain of sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::133 as permitted sender) smtp.mailfrom=sean.m.mcdaniel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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:28985 Archived-At: --00000000000078db3a05c9269e93 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you John. Your suggestions got me most of the way there: the markdown code blocks with the +raw_attribute processing are correctly passing through the sections I want untouched and the +yaml_metadata_block is keeping the header content I want. The remaining issue which is giving me trouble is that +yaml_header_block is also including all other document metadata and not just the variables I've defined, i.e. stuff like autoEqnLabels: false autoSectionLabels: false ccsDelim: ", " ccsLabelSep: =E2=80=94 ccsTemplate: | *i* *c**c**s**L**a**b**e**l**S**e**p* *t* chapDelim: . and so forth. Is there a way to include just the variables I've defined in the converted document? E.g. --- title: My Title metadata: description: 'My description' keywords: 'keyword1, keyword2, keyword3' author: 'Sean McDaniel' sitemap: changefreq: monthly page-toc: active: true process: twig: true --- I've looked at the appropriate section in the Pandoc documentation and it seems like I might need to create a custom template. Is this correct? Thank you, Sean On Sun, Aug 8, 2021 at 2:31 PM John MacFarlane wrote: > Sean McDaniel writes: > > > All, > > > > I need to convert documents from CommonMark to Markdown PHP Extra. Some > of > > my markdown documents have multiple tables in multi-line format that my > > application (Grav CMS) doesn't support. > > > > I'm having two issues with the conversion process that I haven't been > able > > to figure out. > > > > First, I have opening and closing square-bracket tags that I don't want > > converted. E.g. [notice] some text... [/notice] gets converted to > > \[notice\] some text... \[/notice\]. I've tried enclosing these section= s > in > > a plain fenced block but I don't want the text indented. > > > > Is there a way to either prevent backslash escaping of special > characters > > (preferred) > > No. We try to play it safe, and it's very difficult for the > writer to tell if a bracketed text would inadvertently become a link. > > > or keep blocks of text verbatim? > > Well yes, you can mark something as raw Markdown using the "raw attribute= ." > > `[my notice]`{=3Dmarkdown} > > You'll need to tell pandoc to use the raw attribute extension: > > pandoc -f commonmark+raw_attribute -t markdown_phpextra > > > Second, I have a YAML header that I'd like to keep untouched that's > being > > removed. Is there a way to output the same YAML header to my converted > > document? > > Try with > > pandoc -f commonmark+raw_attribute+yaml_metadata_block -t > markdown_phpextra+yaml_metadata_block -s > --=20 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 e= mail 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/CAML5wTUJ%2BsvOhMUi2GwtPw0-_sx-GrRtG5teCihq6WmGXjZ8Cg%40mail= .gmail.com. --00000000000078db3a05c9269e93 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you John. Your suggestions got= me most of the way there: the markdown code blocks with the +raw_attribute= processing are correctly passing through the sections I want untouched and= the +yaml_metadata_block is keeping the header content I want.

The remaining issue which is giving me trouble is that +y= aml_header_block is also including all other document metadata and not just= the variables I've defined, i.e. stuff like

a= utoEqnLabels: false
autoSectionLabels: false
ccsDelim: ", "=
ccsLabelSep: =C2=A0=E2=80=94
ccsTemplate: |
=C2=A0 *i*
=C2=A0 = *c**c**s**L**a**b**e**l**S**e**p*
=C2=A0 *t*
chapDelim: .
<= br>
and so forth.

Is there a way to = include just the variables I've defined in the converted document? E.g.=

---
title: My Title
metadata:
=C2=A0 =C2= =A0 description: 'My description'
=C2=A0 =C2=A0 keywords: 'k= eyword1, keyword2, keyword3'
=C2=A0 =C2=A0 author: 'Sean McDanie= l'
sitemap:
=C2=A0 =C2=A0 changefreq: monthly
page-toc:
=C2= =A0 =C2=A0 active: true
process:
=C2=A0 =C2=A0 twig: true
---

I've looked at the appropriate section in the Pand= oc documentation and it seems like I might need to create a custom template= . Is this correct?

Thank you,
Sean

On Sun, Aug 8, 2021 at 2:31 PM John MacFarlane &= lt;jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org> wrote:
<= /div>
Sean McDaniel <sean.m.mcdanie= l@gmail.com> writes:

> All,
>
> I need to convert documents from CommonMark to Markdown PHP Extra. Som= e of
> my markdown documents have multiple tables in multi-line format that m= y
> application (Grav CMS) doesn't support.
>
> I'm having two issues with the conversion process that I haven'= ;t been able
> to figure out.
>
> First, I have opening and closing square-bracket tags that I don't= want
> converted. E.g. [notice] some text... [/notice] gets converted to
> \[notice\] some text... \[/notice\]. I've tried enclosing these se= ctions in
> a plain fenced block but I don't want the text indented.
>
> Is there a way to either prevent backslash escaping of special charact= ers
> (preferred)

No.=C2=A0 We try to play it safe, and it's very difficult for the
writer to tell if a bracketed text would inadvertently become a link.

> or keep blocks of text verbatim?

Well yes, you can mark something as raw Markdown using the "raw attrib= ute."

=C2=A0 =C2=A0 `[my notice]`{=3Dmarkdown}

You'll need to tell pandoc to use the raw attribute extension:

=C2=A0 =C2=A0 pandoc -f commonmark+raw_attribute -t markdown_phpextra

> Second, I have a YAML header that I'd like to keep untouched that&= #39;s being
> removed. Is there a way to output the same YAML header to my converted=
> document?

Try with

=C2=A0 =C2=A0 =C2=A0pandoc -f commonmark+raw_attribute+yaml_metadata_block = -t markdown_phpextra+yaml_metadata_block -s

--
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://group= s.google.com/d/msgid/pandoc-discuss/CAML5wTUJ%2BsvOhMUi2GwtPw0-_sx-GrRtG5te= Cihq6WmGXjZ8Cg%40mail.gmail.com.
--00000000000078db3a05c9269e93--