Subject: [xml2rfc] Problem with anchor quoting for IANA references

From: Brian Sipos <[email-masked]>
Date: Tue, 27 Apr 2021 16:40:14 +0000

Hello,
There seems to be an attribute quoting issue with (at least) the IANA reference generator resource. For example, if I use the standard anchor I get a valid document:
$ curl -s https://xml2rfc.tools.ietf.org/public/rfc/bibxml-iana/reference.IANA.bundle.xml | head -2
<reference anchor='BUNDLE'
target='http://www.iana.org/assignments/bundle'>

But if I use a custom anchor, the anchor attribute itself is not properly quoted which makes the whole document not well-formed XML:
$ curl -s https://xml2rfc.tools.ietf.org/public/rfc/bibxml-iana/reference.IANA.bundle.xml?anchor=HI | head -2
<reference anchor='HI
target='http://www.iana.org/assignments/bundle'>

Note the lack of a closing quotation in the anchor attribute.

As a workaround, I can add an escaped single-quote character to the query value, which does produce a well-formed reference.

Thanks for any support in this,
Brian S.

---

From: Carsten Bormann <[email-masked]>
Date: Tue, 27 Apr 2021 18:55:42 +0200

> Note the lack of a closing quotation in the anchor attribute.

That is an old bug that already was fixed before.

(I have removed the use of the anchor query parameter from kramdown-rfc because it can do that itself, so I wouldn’t have noticed a regression recently.)

Grüße, Carsten

---

From: Carsten Bormann <[email-masked]>
Date: Tue, 27 Apr 2021 19:04:53 +0200

Oh, and here is the bug:

                txt = re.sub(r"anchor='[^']*'", f"anchor='{self.replacement_anchor}", txt)
                txt = re.sub(r'anchor="[^"]*"', f"anchor='{self.replacement_anchor}'", txt)

Note the missing closing single quote in the first line (bibxml8/index.cgi, line 84).

Grüße, Carsten

> On 2021-04-27, at 18:55, Carsten Bormann <[email-masked]> wrote:
> 
> _______________________________________________
> xml2rfc mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc