From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/25600 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "T. Kurt Bond" Newsgroups: gmane.text.pandoc Subject: Extra Blank Line in Native AST for RST Input with Include Directive with :code: Date: Tue, 7 Jul 2020 00:51:41 -0400 Message-ID: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000f707c105a9d2bf46" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27129"; mail-complaints-to="usenet@ciao.gmane.io" Cc: CPaulBond To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-X-From: pandoc-discuss+bncBDJYFKFHUYHRB2P6R74AKGQEO2KXFWQ-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Tue Jul 07 06:51:57 2020 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-io1-f63.google.com ([209.85.166.63]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jsfaG-0006w9-Oz for gtp-pandoc-discuss@m.gmane-mx.org; Tue, 07 Jul 2020 06:51:56 +0200 Original-Received: by mail-io1-f63.google.com with SMTP id l13sf25090633ioj.5 for ; Mon, 06 Jul 2020 21:51:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1594097515; cv=pass; d=google.com; s=arc-20160816; b=DgoK9qg9+HCWQKutbxBMKUcxjairjYTgOsrAd6DaXbLF2mocRCbxH5PVpiMle0s/te 6S9eFmZhrtOa2Kh4CIXpmew/x5k/N/mtf+vRSgoumV/+b4xUqy0p/6GhE4LxRuqHaMxd 2nv+emoE3nYAWTTeZQKhPuaAyizshp47INixPHGhT87UkfjzJeCtrbVajdvuax2mTI2M 7rZ+KK0tvh/R/MgoJh04/UB+iQkyT2W9O+h3/bdT0h14gkgImxhLUmtNL3K9K24BoqqI GfIzr3Ew/TUpck1louvrQgv74PkvaFFsk/+Vfft27NZFhmi+1N8I6GRTJ6lO3hKXnwVJ Fu8w== 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:mime-version:sender:dkim-signature:dkim-signature; bh=xPlhjpJB1GBVhEvG9TgB2Sp+nTsAR3u1k4d95s+afGY=; b=QDgzscwcX+UDRo0lwleQ9N0wyLcDayU3zIj1z2e5VXCy3J3tnaCLN0w7uv9Ia8T/9C st/vUdDbJbvcAJl4OJ9boxKyWSHS3707kIf6JNAVAh+sP+N+Ls2vgZXEPsJyH/4aHzaz 7oyhQITAnD+ATMYQk8yKHtto669WObJJjdqjl6w9cZcroebWpa+Zv7pf2uixoyMUDzXf EKpjzQo38RQZHeIW2lvYQaryajKe8NPZfReMY47PQAEoc/vwkXUpsSnQzdCXAXZ/7DB5 0secEXBzeAT7TF5D1RqqlxUGH4uAmuYyotzLgD1kKm2b37g/Xzd6V0D+8W69EXmnjYw5 VsEg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qpD4huEM; spf=pass (google.com: domain of tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d29 as permitted sender) smtp.mailfrom=tkurtbond-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: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=xPlhjpJB1GBVhEvG9TgB2Sp+nTsAR3u1k4d95s+afGY=; b=HK9EMDupHLl/lgTcrcZEC7RUh+bpju0KuEgyzZwFtcVKMw+QDojs5BNVBk8kXwb64L wjQ8nd6VvMDbzJd3en+8Nm7/S9CCG6zoLLriZ79ATHmTnKHWqC+jZoku/NSwr+eN0bd+ LedNsmvvTm4rxVRtUg146KCmua/dD2smiKzzzbzSV18ijMAlLusedZr5Fi4OcyUE9b1R L2atNFY4tDQ9Ws5nDgT6WFmshKx00rjS1N4j+VsIYat9x+GmreB2MjybZPQPSwMrRg8t RcX6jKqoFMPN4HJxoDZLBkJGjqXxmCInw0i/TbLcW3C2mdiu07cwfA/+ZkCqVV+22w1j HIrg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version: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=xPlhjpJB1GBVhEvG9TgB2Sp+nTsAR3u1k4d95s+afGY=; b=AzOM7ExK8L3oMhkMHTbEtXkX2XVYvCfSMUEN3t2Bhm6+5wf2W1PYyxn0m7PlgbnFpO V10Tr6f1Llfwiucq3/kUGJ7k97iMwcmQjk4DHBWMnc4nnPwmcqrBXKxOgcshM6Bw/G/V AjSEI427ci99Bi2pOMn+8Jb0Xn8pdkPwdzLSzw42SUYNRIrAyL+fTnRWHBP2Fcz5bo0i YMtGqnhu4zhH4GXAyNb79qTjrppr34eADHKCOzhZ3i+to0bjLin4UtbbY5yFV7WpgcoY r7DKIpFVntcGYX9PVMyDYMnvlKs/mGIQ/mfyxrcKl5zpo51qrgIbVE13sdvCyayRdb8c yl0A== 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: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=xPlhjpJB1GBVhEvG9TgB2Sp+nTsAR3u1k4d95s+afGY=; b=QGpnvpZspVOz8sRbZ9YwN95zP/CIv0WiwjlagLHVOgyiLvagu1h1Oo7IYW5EepDhVF DKLXMB++epgsRg5QWmTX0bP1pvxXroniIlD9BEcZX8UrbNCYMiwR2mOZrHFH14uCCdKo BxhLvBJ+tL8/xRyQ+w96V0SDYdXU2m66sDU2ojE4RmeW2NHjTp2IkRGBuN1c8fiPMEXf rVKABMIUaBqIvegHqQl0ICEJLZFJeeMCmaQYD5FGkIzXypVAGJLQC/GW5mwvwWbl5XQj XhdhUs+oQl0FLtcVi1ZNt2CAmOxGbeFb6IAOA+jqM7K2nZFRzocwNEWwxrqpydLSsMJk borQ== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AOAM532AM/bQdbtsQ/g0hIpNYdjIxzAsPx1J1HbZEwLt++R3GxMutb6a IqJKaBmuExUv1UL/aU6ZUeQ= X-Google-Smtp-Source: ABdhPJzWIpgSLzHD4BcoxJesY3QSTfsU7sjjNFPDChc9604jMi+LA4pcya1QcdPXJ63ygN7R2LCrTw== X-Received: by 2002:a05:6602:15ca:: with SMTP id f10mr29645654iow.52.1594097515743; Mon, 06 Jul 2020 21:51:55 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a5e:d719:: with SMTP id v25ls3455412iom.6.gmail; Mon, 06 Jul 2020 21:51:53 -0700 (PDT) X-Received: by 2002:a5e:c30f:: with SMTP id a15mr29498854iok.184.1594097513124; Mon, 06 Jul 2020 21:51:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594097513; cv=none; d=google.com; s=arc-20160816; b=GAt1x4gssbxEJYjDEmUTM6cFs3/YCMP44ReKLFgUYp25VFUxk+eKRGhRwdncOaTOnQ qeOMvqGH0ua1nS8m/tTEGylH5CspOFfJWGsb1RI0OIMzY5fIQjdh/Xi32DbICYuYYbom 3AtGgKQwfzkCIrwmYx1Eucft42DA9P7OfyTTFOUxdgKlaCo1SPGB6R4+Gquy/Gj0/u25 h9LLQUzDPk9fgBeVFZgldzUO7TDZbEBsDOZ6vj0rkrjs8HmZeMvzu4xLk+K4gW+QhCa/ 7mLmjT1pwhMXt09cdVIdDf1erBL5ZTtTsfYcd88Y50Uk5Tn+kgVq7/BAag4l1+0yPE7j WEyw== 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:mime-version:dkim-signature; bh=UFe5e4/hLtbpkqZZeANjLxWuLmgIdTFv4lKSa7aTjqE=; b=OouJKJS12I/CbSdHIuxibuvTkeK1VkfWP6j/glUNJQvzJuX/AX0v/pcjaeVuBt1xvO tRaCIP4SDKo0viAnOJyRCiJeWTpXAAdtPgv5i+GbyuXKXF25L4qMrO1XU73Fwj7Xi2zF 35+34GukjJgmaWZ1A1URVwzY5UYT1JgOfdTqe45L9P4j6AN+6WKqVsbeqX7iWnfnmWzE P9yrysfcozHbewl+BtYi7wp93upcTRWPwDVwQvSNAyiYXj32TAOWeBAldClX62LhR60R Ro/lgFStDpiKVAmiNOI82tMyb9qGAF5neg7GzwClZ/uGZfUqrvDRwKTSAk1UEKwBwn6+ AXdw== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qpD4huEM; spf=pass (google.com: domain of tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d29 as permitted sender) smtp.mailfrom=tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Original-Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com. [2607:f8b0:4864:20::d29]) by gmr-mx.google.com with ESMTPS id o15si1237572ilg.3.2020.07.06.21.51.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Jul 2020 21:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d29 as permitted sender) client-ip=2607:f8b0:4864:20::d29; Original-Received: by mail-io1-xd29.google.com with SMTP id i25so41906077iog.0 for ; Mon, 06 Jul 2020 21:51:53 -0700 (PDT) X-Received: by 2002:a6b:b78d:: with SMTP id h135mr29216008iof.151.1594097512415; Mon, 06 Jul 2020 21:51:52 -0700 (PDT) X-Original-Sender: tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qpD4huEM; spf=pass (google.com: domain of tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org designates 2607:f8b0:4864:20::d29 as permitted sender) smtp.mailfrom=tkurtbond-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:25600 Archived-At: --000000000000f707c105a9d2bf46 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Note *The ``text/plain`` alternative may look =E2=80=A6 odd.* I'm trying to make this readable both as text/html e-mail and text/plain bu= t have little control over how the text/plain alternative comes out. I've added extra horizontal rules before the included files to make the file contents stand out more, even though the text/html alternative doesn't need it. Unfortunately, the automatic process that converts the text/html alternative into the text/plan alternative leaves blank lines before and after the file contents, which is distressing since the bug I'm talking about is about an extra blank line. Gmail, sometimes I hate you. It turns out that the -w native output of an RST input file with an include directive with the :code: option shows that there is an extra blank line at the end of the CodeBlock in the AST. This causes the generated output for HTML, ms, LaTeX, and ConTeXt to have extra blank lines at the ends of those code blocks. My Pandoc version is: pandoc 2.9.2.1 Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2 My OS information is: Mac OS X, Version 10.15.4, Build 19E287 I generated the output to check with the following commands: pandoc -r rst -w native --output=3Delii-rst.native elii.rst pandoc -r rst -w html --output=3Delii-rst.html elii.rst pandoc -r rst -w ms --output=3Delii-rst.ms elii.rst pandoc -r rst -w latex --pdf-engine=3Dxelatex --output=3Delii-rst.ltx elii.= rst pandoc -r rst -w context --output=3Delii-rst.ctx elii.rst (I'm only going to include the native and HTML output in this message, but I did check the other output formats.) So, for the ReStructuredText input (file elii.rst): ------------------------------ Extra Line in Include Directive Output for HTML, ms, LaTeX, and ConTeXt Out= put @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@= @@@ Here's a ``include`` directive **without** a ``:code:`` option: .. include:: three.txt Did it have an extra line at the end? **No**, in HTML, ms, LaTeX, and ConTeXt output. Note that this will not show up when the HTML is rendered as a web page, just in the HTML source itself. Here's a ``include`` directive with a ``:code:`` option: .. include:: three.txt :code: Did it have an extra line at the end? **Yes**, in HTML, ms, LaTeX, and ConTeXt output. ------------------------------ which includes a text file (three.txt) using the include directive with a :code: option: ------------------------------ 1st line. 2nd line. 3rd line. ------------------------------ the resulting native output (elii-rst.native) is generated: ------------------------------ [Header 1 ("extra-line-in-include-directive-output-for-html-ms-latex-and-co= ntext-output",[],[]) [Str "Extra",Space,Str "Line",Space,Str "in",Space,Str "Include",Space,Str "Directive",Space,Str "Output",Space,Str "for",Space,Str "HTML,",Space,Str "ms,",Space,Str "LaTeX,",Space,Str "and",Space,Str "ConTeXt",Space,Str "Output"] ,Para [Str "Here's",Space,Str "a",Space,Code ("",[],[]) "include",Space,Str "directive",Space,Strong [Str "without"],Space,Str "a",Space,Code ("",[],[]) ":code:",Space,Str "option:"] ,Para [Str "1st",Space,Str "line.",SoftBreak,Str "2nd",Space,Str "line.",SoftBreak,Str "3rd",Space,Str "line."] ,Para [Str "Did",Space,Str "it",Space,Str "have",Space,Str "an",Space,Str "extra",Space,Str "line",Space,Str "at",Space,Str "the",Space,Str "end?",Space,Strong [Str "No"],Str ",",Space,Str "in",Space,Str "HTML,",Space,Str "ms,",Space,Str "LaTeX,",SoftBreak,Str "and",Space,Str "ConTeXt",Space,Str "output.",Space,Str "Note",Space,Str "that",Space,Str "this",Space,Str "will",Space,Str "not",Space,Str "show",Space,Str "up",Space,Str "when",Space,Str "the",Space,Str "HTML",Space,Str "is",SoftBreak,Str "rendered",Space,Str "as",Space,Str "a",Space,Str "web",Space,Str "page,",Space,Str "just",Space,Str "in",Space,Str "the",Space,Str "HTML",Space,Str "source",Space,Str "itself."] ,Para [Str "Here's",Space,Str "a",Space,Code ("",[],[]) "include",Space,Str "directive",Space,Str "with",Space,Str "a",Space,Code ("",[],[]) ":code:",Space,Str "option:"] ,CodeBlock ("",[""],[]) "1st line.\n2nd line.\n3rd line.\n\n" ,Para [Str "Did",Space,Str "it",Space,Str "have",Space,Str "an",Space,Str "extra",Space,Str "line",Space,Str "at",Space,Str "the",Space,Str "end?",Space,Strong [Str "Yes"],Str ",",Space,Str "in",Space,Str "HTML,",Space,Str "ms,",Space,Str "LaTeX,",SoftBreak,Str "and",Space,Str "ConTeXt",Space,Str "output."]] ------------------------------ If you look at the CodeBlock element you can see it ends with \n\n. The original included text file ends with just one \n. The HTML output (elii-rst.html) is: ------------------------------

Extra Line in Include Directive Output for HTML, ms, LaTeX, and ConTeXt Output

Here's a include directive without a :code: option:

1st line. 2nd line. 3rd line.

Did it have an extra line at the end? No, in HTML, ms, LaTeX, and ConTeXt output. Note that this will not show up when the HTML is rendered as a web page, just in the HTML source itself.

Here's a include directive with a :code: option:

1st line.
2nd line.
3rd line.

Did it have an extra line at the end? Yes, in HTML, ms, LaTeX, and ConTeXt output.

------------------------------ I've checked and HTML, ms, LaTeX, and ConTeXt output all have these blank lines at the end of generated text for those code blocks. ------------------------------ *Note:* This message was written as RST input with include directives with the :code: option but does not have the extra blank lines at the ends of the included code (at least in the text/html alternative, see the note about the text/plain alternative at the beginning of this message) because I preprocessed it with pandoc -s -r rst -w rst -o elii-email.rst elii-email-in.rst which converted the include directives with the :code: option to inline code directives, which don't the extra lines at the end. Very useful workaround. I use *GNU Make* to build all the various generated files. --=20 T. Kurt Bond, tkurtbond-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, https://tkurtbond.github.io --=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/CAN1EhV_L54%3DmKnSxiNwKNoKZ2CXNe7pVXM8ZtBe_D%2BkAZ_KURg%40ma= il.gmail.com. --000000000000f707c105a9d2bf46 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Note

The ``text/plain`` alternative may look =E2=80=A6 odd.

I'm trying to make this readable= both as=C2=A0text/html=C2=A0e-mail and= =C2=A0text/plain=C2=A0but have little c= ontrol over how the=C2=A0text/plain=C2= =A0alternative comes out. I've added extra horizontal rules before the = included files to make the file contents stand out more, even though the=C2= =A0text/html=C2=A0alternative doesn'= ;t need it. Unfortunately, the automatic process that converts the=C2=A0text/html=C2=A0alternative into the=C2=A0<= code style=3D"white-space:nowrap;font-family:Consolas,"Liberation Mono= ",Courier,monospace;font-size:12px;margin:0px 2px;padding:0px 5px;bord= er:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radi= us:3px;color:rgb(51,51,51)">text/plan=C2=A0alternative leaves blank = lines before and after the file contents, which is distressing since the bu= g I'm talking about is about an extra blank line. Gmail, sometimes I ha= te you.

It turns out that = the=C2=A0-w native=C2=A0output of an RS= T input file with an=C2=A0include=C2=A0= directive with the=C2=A0:code:=C2=A0opt= ion shows that there is an extra blank line at the end of the=C2=A0CodeBlock=C2=A0in the AST. This causes the gene= rated output for HTML, ms, LaTeX, and ConTeXt to have extra blank lines at = the ends of those code blocks.

M= y Pandoc version is:

pandoc 2.9=
.2.1
Compiled with pandoc-types 1.20, texmath 0.12.0.1, skylighting 0.8.3.2

My OS information is:

Mac OS X, Version 10.15.4, Build 19E= 287

I generated the out= put to check with the following commands:

pandoc -r rst -w native --output=3Delii-rst.native elii.rst
pandoc -r rst -w html --output=3Delii-rst.html elii.rst
pandoc -r rst -w ms --output=3Delii-rst.ms elii.rst
pandoc -r rst -w latex --pdf-engine=3Dxelatex --output=3Delii-rst.ltx elii.=
rst
pandoc -r rst -w context --output=3Delii-rst.ctx elii.rst

(I'm only going to include the nativ= e and HTML output in this message, but I did check the other output formats= .)

So, for the ReStructuredText = input (file=C2=A0elii.rst):


Extra Line in Include Directive Output for HTML, ms, LaTeX, and ConTe=
Xt Output
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=
@@@

Here's a ``include`` directive **without** a ``:code:`` option:

.. include:: three.txt

Did it have an extra line at the end?  **No**, in HTML, ms, LaTeX,
and ConTeXt output.  Note that this will not show up when the HTML is
rendered as a web page, just in the HTML source itself.

Here's a ``include`` directive with a ``:code:`` option:

.. include:: three.txt
   :code:

Did it have an extra line at the end?  **Yes**, in HTML, ms, LaTeX,
and ConTeXt output.

which includes a text file (three.txt) using the=C2=A0include=C2=A0directive with a=C2=A0:code:=C2=A0option:


1st line.
2nd line.
3rd line.

the resulting=C2=A0native=C2=A0output (elii-rst.na= tive) is generated:


[Header 1 ("extra-line-in-=
include-directive-output-for-html-ms-latex-and-context-output",[],[]) =
[Str "Extra",Space,Str "Line",Space,Str "in",=
Space,Str "Include",Space,Str "Directive",Space,Str &qu=
ot;Output",Space,Str "for",Space,Str "HTML,",Space=
,Str "ms,",Space,Str "LaTeX,",Space,Str "and"=
,Space,Str "ConTeXt",Space,Str "Output"]
,Para [Str "Here's",Space,Str "a",Space,Code ("=
;",[],[]) "include",Space,Str "directive",Space,St=
rong [Str "without"],Space,Str "a",Space,Code ("&q=
uot;,[],[]) ":code:",Space,Str "option:"]
,Para [Str "1st",Space,Str "line.",SoftBreak,Str "=
2nd",Space,Str "line.",SoftBreak,Str "3rd",Space,S=
tr "line."]
,Para [Str "Did",Space,Str "it",Space,Str "have&qu=
ot;,Space,Str "an",Space,Str "extra",Space,Str "li=
ne",Space,Str "at",Space,Str "the",Space,Str "=
;end?",Space,Strong [Str "No"],Str ",",Space,Str &=
quot;in",Space,Str "HTML,",Space,Str "ms,",Space,S=
tr "LaTeX,",SoftBreak,Str "and",Space,Str "ConTeXt=
",Space,Str "output.",Space,Str "Note",Space,Str &=
quot;that",Space,Str "this",Space,Str "will",Space=
,Str "not",Space,Str "show",Space,Str "up",Sp=
ace,Str "when",Space,Str "the",Space,Str "HTML&quo=
t;,Space,Str "is",SoftBreak,Str "rendered",Space,Str &q=
uot;as",Space,Str "a",Space,Str "web",Space,Str &q=
uot;page,",Space,Str "just",Space,Str "in",Space,S=
tr "the",Space,Str "HTML",Space,Str "source",=
Space,Str "itself."]
,Para [Str "Here's",Space,Str "a",Space,Code ("=
;",[],[]) "include",Space,Str "directive",Space,St=
r "with",Space,Str "a",Space,Code ("",[],[]) =
":code:",Space,Str "option:"]
,CodeBlock ("",[""],[]) "1st line.\n2nd line.\n3rd=
 line.\n\n"
,Para [Str "Did",Space,Str "it",Space,Str "have&qu=
ot;,Space,Str "an",Space,Str "extra",Space,Str "li=
ne",Space,Str "at",Space,Str "the",Space,Str "=
;end?",Space,Strong [Str "Yes"],Str ",",Space,Str =
"in",Space,Str "HTML,",Space,Str "ms,",Space,=
Str "LaTeX,",SoftBreak,Str "and",Space,Str "ConTeX=
t",Space,Str "output."]]

If you loo= k at the CodeBlock element you can see it ends with=C2=A0\n\n. The original included text file ends with just one= =C2=A0\n.

The HTML output (elii-rst.html) is:


<h1 id=3D"extra-line-in-include-directi=
ve-output-for-html-ms-latex-and-context-output">Extra Line in Inclu=
de Directive Output for HTML, ms, LaTeX, and ConTeXt Output</h1>
<p>Here's a <code>include</code> directive <strong=
>without</strong> a <code>:code:</code> option:</p&=
gt;
<p>1st line. 2nd line. 3rd line.</p>
<p>Did it have an extra line at the end? <strong>No</strong&=
gt;, in HTML, ms, LaTeX, and ConTeXt output. Note that this will not show u=
p when the HTML is rendered as a web page, just in the HTML source itself.&=
lt;/p>
<p>Here's a <code>include</code> directive with a <=
;code>:code:</code> option:</p>
<pre class=3D""><code>1st line.
2nd line.
3rd line.

</code></pre>
<p>Did it have an extra line at the end? <strong>Yes</strong=
>, in HTML, ms, LaTeX, and ConTeXt output.</p>

I've checked and HTML, ms, LaTeX, and ConTeXt output all have the= se blank lines at the end of generated text for those code blocks.


Note:=C2=A0This message was written as RST input w= ith=C2=A0include=C2=A0directives with t= he=C2=A0:code:=C2=A0option but does not= have the extra blank lines at the ends of the included code (at least in t= he=C2=A0text/html=C2=A0alternative, see= the note about the=C2=A0text/plain=C2= =A0alternative at the beginning of this message) because I preprocessed it = with

pandoc -s -r rst -w rst -o=
 elii-email.rst elii-email-in.rst

which converted the=C2=A0includ= e=C2=A0directives with the=C2=A0:code:<= /code>=C2=A0option to inline=C2=A0code= =C2=A0directives, which don't the extra lines at the end. Very useful w= orkaround. I use=C2=A0GNU Make=C2=A0to build all the vario= us generated files.


--

--
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://gro= ups.google.com/d/msgid/pandoc-discuss/CAN1EhV_L54%3DmKnSxiNwKNoKZ2CXNe7pVXM= 8ZtBe_D%2BkAZ_KURg%40mail.gmail.com.
--000000000000f707c105a9d2bf46--