Markdown.pl: do not leave remnant state lying around
commite004a5275cc64636444f2c4d6006648e2985f597
authorKyle J. McKay <mackyle@gmail.com>
Sat, 13 Feb 2021 04:32:41 +0000 (12 21:32 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 13 Feb 2021 04:32:41 +0000 (12 21:32 -0700)
tree8f8b1160e99fe9c655e863072928818c860e660d
parent32862223ad2e8446a0cbb100d90b2bd4d7938dfe
Markdown.pl: do not leave remnant state lying around

When commit c86fea4089ffa6f22204e8192ce8d73a13e15cc6 ("Markdown:
enhance link handling", 2019-10-20, markdown_1.1.8) did its thing,
a new global (%g_anchors_id) was introduced to keep track of all
the link ids being used/generated in order to better connect them
up to the links meant to target them.

Unfortunately, that hash was not getting cleared before processing
each new document.  While this is mostly not a problem when running
from the command line since typically only one document ever gets
processed at once, if more than one document is processed at a time,
prior documents could affect the link fragment targets for subsequent
documents.

Correct the problem by properly resetting the global (along with
all the others that are also reset) before processing a new document.

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