Markdown.pl: do not choke on <br></br> etc.
commit35c983c9f06d0a0f1a635648a156c945d60d924a
authorKyle J. McKay <mackyle@gmail.com>
Tue, 16 Mar 2021 05:41:52 +0000 (15 22:41 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 16 Mar 2021 05:41:52 +0000 (15 22:41 -0700)
treef7ad7d6550a54782dd9015f1f9ac493659c37327
parent658edb6abf8a45ab405741306dbc3b0c70df784c
Markdown.pl: do not choke on <br></br> etc.

Adjust code to properly handle "empty" tags that are written as an open
plus closing tag but do not contain any whitespace in the opening tag.

The code already properly handles turning <hr noshade></hr> into
just <hr noshade="noshade" />, but it was failing to handle that
when the opening tag did not contain any whitespace such as <br></br>.

Adjust the code to return the proper value for the opening tag under
such a condition so that it's handled properly.

Previously a sequence such as <br></br> would fail as it would end
up being turned into <br /></br> which then fails XML validation.

Now it works properly and turns <br></br> into <br /> as it should
have been doing all along.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Markdown.pl