Re: [Rfc-markdown] empty include files

Carsten Bormann <cabo@tzi.org> Sun, 12 December 2021 21:56 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: rfc-markdown@ietfa.amsl.com
Delivered-To: rfc-markdown@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 7C5143A0BEF for <rfc-markdown@ietfa.amsl.com>; Sun, 12 Dec 2021 13:56:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6O6EY51NEvwi for <rfc-markdown@ietfa.amsl.com>; Sun, 12 Dec 2021 13:56:35 -0800 (PST)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [134.102.50.15]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0DCAF3A0BEC for <Rfc-markdown@ietf.org>; Sun, 12 Dec 2021 13:56:33 -0800 (PST)
Received: from [192.168.217.118] (p5089a436.dip0.t-ipconnect.de [80.137.164.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4JBz4H2JRnzDCv0; Sun, 12 Dec 2021 22:56:31 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <16473.1639345122@localhost>
Date: Sun, 12 Dec 2021 22:56:30 +0100
Cc: Rfc-markdown@ietf.org
X-Mao-Original-Outgoing-Id: 661038990.7082061-eb7b7a8fbdcf6e4226ba79d1737e48be
Content-Transfer-Encoding: quoted-printable
Message-Id: <5D2A4511-A06E-468F-A658-D0C023E8BC39@tzi.org>
References: <16473.1639345122@localhost>
To: Michael Richardson <mcr@sandelman.ca>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/rfc-markdown/qHdmqp9LO01PjtLrtMkd924GC_w>
Subject: Re: [Rfc-markdown] empty include files
X-BeenThere: rfc-markdown@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "rfc-markdown is a discussion list for people writing I-Ds and RFCs in Markdown and the authors of the tools used for that." <rfc-markdown.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rfc-markdown>, <mailto:rfc-markdown-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/rfc-markdown/>
List-Post: <mailto:rfc-markdown@ietf.org>
List-Help: <mailto:rfc-markdown-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rfc-markdown>, <mailto:rfc-markdown-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Dec 2021 21:56:40 -0000

Hi Michael.

> Line 351 says:
>        <artwork name="" type="" align="left" alt=""><![CDATA[
> ]]></artwork>
> 
> As a result of:
> ~~~~
> {::include yang/ietf-voucher-tree-latest.txt}
> ~~~~

The kramdown-rfc part of this works as designed.

> Putting some content ("HELLO") into yang/ietf-voucher-tree-latest.txt makes
> xml2rfc happy.
> 
> This feels like an XML2RFC bug in that it can't cope with an empty artwork.
> The diagnostics from xml2rfc seems off too, since the input doesn't have what
> was provided.
> 
> But, maybe kramdown-rfc2629 is at fault for daring to include no content.

First of all, there is nothing wrong with the {::include} mechanism here.

Without any use of {::include}, an empty code block as in...

~~~
~~~

…will give you…

<figure><artwork><![CDATA[
]]></artwork></figure>

(Note that kramdown-rfc prepends a newline to every piece of artwork that doesn’t already start with a newline because of earlier xml2rfc idiosyncrasies; I don’t know if this is strictly necessary any more.)

Second, the definition of <artwork> [1] does not contain any text that would declare empty artwork undesirable.  It should probably rule out blank (not just empty) artwork, but it doesn’t.  In any case, kramdown-rfc gave xml2rfc what you specified it should.

Yes, there is xml2rfc behavior here that could be called a bug, but then if it silently took blank artwork that wouldn’t be too helpful either.  Kramdown-rfc does not attempt to mirror all the “helpfulness” of xml2rfc, so there you are.

Grüße, Carsten

[1]: https://xml2rfc.tools.ietf.org/xml2rfc-doc.html#name-artwork-2